Class VaultLock
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_lockargument 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_lockargument totrue. When changingcomplete_locktotrue, 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 the ignore_deletion_error argument to true 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
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var exampleVault = new Aws.Glacier.Vault("exampleVault", new Aws.Glacier.VaultArgs
{
});
var examplePolicyDocument = exampleVault.Arn.Apply(arn => Aws.Iam.GetPolicyDocument.InvokeAsync(new Aws.Iam.GetPolicyDocumentArgs
{
Statements =
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementArgs
{
Actions =
{
"glacier:DeleteArchive",
},
Condition =
{
{
{ "test", "NumericLessThanEquals" },
{ "values",
{
"365",
} },
{ "variable", "glacier:ArchiveAgeinDays" },
},
},
Effect = "Deny",
Resources =
{
arn,
},
},
},
}));
var exampleVaultLock = new Aws.Glacier.VaultLock("exampleVaultLock", new Aws.Glacier.VaultLockArgs
{
CompleteLock = false,
Policy = examplePolicyDocument.Apply(examplePolicyDocument => examplePolicyDocument.Json),
VaultName = exampleVault.Name,
});
}
}
Permanently Applying Glacier Vault Lock Policy
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Glacier.VaultLock("example", new Aws.Glacier.VaultLockArgs
{
CompleteLock = true,
Policy = data.Aws_iam_policy_document.Example.Json,
VaultName = aws_glacier_vault.Example.Name,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Glacier
Assembly: Pulumi.Aws.dll
Syntax
public class VaultLock : CustomResource
Constructors
View SourceVaultLock(String, VaultLockArgs, CustomResourceOptions)
Create a VaultLock resource with the given unique name, arguments, and options.
Declaration
public VaultLock(string name, VaultLockArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| VaultLockArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCompleteLock
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.
Declaration
public Output<bool> CompleteLock { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
IgnoreDeletionError
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.
Declaration
public Output<bool?> IgnoreDeletionError { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Policy
JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.
Declaration
public Output<string> Policy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VaultName
The name of the Glacier Vault.
Declaration
public Output<string> VaultName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, VaultLockState, CustomResourceOptions)
Get an existing VaultLock resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static VaultLock Get(string name, Input<string> id, VaultLockState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| VaultLockState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| VaultLock |