Vault Lock Args
Manages a Glacier Vault Lock. You can refer to the Glacier Developer Guide for a full explanation of the Glacier Vault Lock functionality.
NOTE: This resource allows you to test Glacier Vault Lock policies by setting the
complete_lock
argument tofalse
. When testing policies in this manner, the Glacier Vault Lock automatically expires after 24 hours and this provider will show this resource as needing recreation after that time. To permanently apply the policy, set thecomplete_lock
argument totrue
. When changingcomplete_lock
totrue
, it is expected the resource will show as recreating. !>WARNING: Once a Glacier Vault Lock is completed, it is immutable. The deletion of the Glacier Vault Lock is not be possible and attempting to remove it from this provider will return an error. Set theignore_deletion_error
argument totrue
and apply this configuration before attempting to delete this resource via this provider or remove this resource from this provider's management.
Example Usage
Testing Glacier Vault Lock Policy
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glacier.Vault;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.glacier.VaultLock;
import com.pulumi.aws.glacier.VaultLockArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleVault = new Vault("exampleVault");
final var examplePolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.actions("glacier:DeleteArchive")
.effect("Deny")
.resources(exampleVault.arn())
.conditions(GetPolicyDocumentStatementConditionArgs.builder()
.test("NumericLessThanEquals")
.variable("glacier:ArchiveAgeinDays")
.values("365")
.build())
.build())
.build());
var exampleVaultLock = new VaultLock("exampleVaultLock", VaultLockArgs.builder()
.completeLock(false)
.policy(examplePolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(examplePolicyDocument -> examplePolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
.vaultName(exampleVault.name())
.build());
}
}
Permanently Applying Glacier Vault Lock Policy
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.glacier.VaultLock;
import com.pulumi.aws.glacier.VaultLockArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new VaultLock("example", VaultLockArgs.builder()
.completeLock(true)
.policy(data.aws_iam_policy_document().example().json())
.vaultName(aws_glacier_vault.example().name())
.build());
}
}
Import
Glacier Vault Locks can be imported using the Glacier Vault name, e.g.,
$ pulumi import aws:glacier/vaultLock:VaultLock example example-vault
Properties
Boolean whether to permanently apply this Glacier Lock Policy. Once completed, this cannot be undone. If set to false
, the Glacier Lock Policy remains in a testing mode for 24 hours. After that time, the Glacier Lock Policy is automatically removed by Glacier and the this provider resource will show as needing recreation. Changing this from false
to true
will show as resource recreation, which is expected. Changing this from true
to false
is not possible unless the Glacier Vault is recreated at the same time.
Allow this provider to ignore the error returned when attempting to delete the Glacier Lock Policy. This can be used to delete or recreate the Glacier Vault via this provider, for example, if the Glacier Vault Lock policy permits that action. This should only be used in conjunction with complete_lock
being set to true
.