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_lock argument to false. 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 the complete_lock argument to true. When changing complete_lock to true, 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",
                    },
                    Conditions = 
                    {
                        new Aws.Iam.Inputs.GetPolicyDocumentStatementConditionArgs
                        {
                            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,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/glacier"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleVault, err := glacier.NewVault(ctx, "exampleVault", nil)
        if err != nil {
            return err
        }
        _, err = glacier.NewVaultLock(ctx, "exampleVaultLock", &glacier.VaultLockArgs{
            CompleteLock: pulumi.Bool(false),
            Policy: examplePolicyDocument.ApplyT(func(examplePolicyDocument iam.GetPolicyDocumentResult) (string, error) {
                return examplePolicyDocument.Json, nil
            }).(pulumi.StringOutput),
            VaultName: exampleVault.Name,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example_vault = aws.glacier.Vault("exampleVault")
example_policy_document = example_vault.arn.apply(lambda arn: aws.iam.get_policy_document(statements=[{
    "actions": ["glacier:DeleteArchive"],
    "conditions": [{
        "test": "NumericLessThanEquals",
        "values": ["365"],
        "variable": "glacier:ArchiveAgeinDays",
    }],
    "effect": "Deny",
    "resources": [arn],
}]))
example_vault_lock = aws.glacier.VaultLock("exampleVaultLock",
    complete_lock=False,
    policy=example_policy_document.json,
    vault_name=example_vault.name)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleVault = new aws.glacier.Vault("example", {});
const examplePolicyDocument = exampleVault.arn.apply(arn => aws.iam.getPolicyDocument({
    statements: [{
        actions: ["glacier:DeleteArchive"],
        conditions: [{
            test: "NumericLessThanEquals",
            values: ["365"],
            variable: "glacier:ArchiveAgeinDays",
        }],
        effect: "Deny",
        resources: [arn],
    }],
}, { async: true }));
const exampleVaultLock = new aws.glacier.VaultLock("example", {
    completeLock: false,
    policy: 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,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/glacier"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := glacier.NewVaultLock(ctx, "example", &glacier.VaultLockArgs{
            CompleteLock: pulumi.Bool(true),
            Policy:       pulumi.String(data.Aws_iam_policy_document.Example.Json),
            VaultName:    pulumi.String(aws_glacier_vault.Example.Name),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.glacier.VaultLock("example",
    complete_lock=True,
    policy=data["aws_iam_policy_document"]["example"]["json"],
    vault_name=aws_glacier_vault["example"]["name"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.glacier.VaultLock("example", {
    completeLock: true,
    policy: aws_iam_policy_document_example.json,
    vaultName: aws_glacier_vault_example.name,
});

Create a VaultLock Resource

def VaultLock(resource_name, opts=None, complete_lock=None, ignore_deletion_error=None, policy=None, vault_name=None, __props__=None);
func NewVaultLock(ctx *Context, name string, args VaultLockArgs, opts ...ResourceOption) (*VaultLock, error)
public VaultLock(string name, VaultLockArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VaultLockArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VaultLockArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VaultLockArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

VaultLock Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The VaultLock resource accepts the following input properties:

CompleteLock bool

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.

Policy string

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

VaultName string

The name of the Glacier Vault.

IgnoreDeletionError bool

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.

CompleteLock bool

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.

Policy string

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

VaultName string

The name of the Glacier Vault.

IgnoreDeletionError bool

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.

completeLock boolean

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.

policy string

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

vaultName string

The name of the Glacier Vault.

ignoreDeletionError boolean

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.

complete_lock bool

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.

policy str

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

vault_name str

The name of the Glacier Vault.

ignore_deletion_error bool

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the VaultLock resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing VaultLock Resource

Get an existing VaultLock resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VaultLockState, opts?: CustomResourceOptions): VaultLock
static get(resource_name, id, opts=None, complete_lock=None, ignore_deletion_error=None, policy=None, vault_name=None, __props__=None);
func GetVaultLock(ctx *Context, name string, id IDInput, state *VaultLockState, opts ...ResourceOption) (*VaultLock, error)
public static VaultLock Get(string name, Input<string> id, VaultLockState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

CompleteLock bool

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.

IgnoreDeletionError bool

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.

Policy string

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

VaultName string

The name of the Glacier Vault.

CompleteLock bool

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.

IgnoreDeletionError bool

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.

Policy string

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

VaultName string

The name of the Glacier Vault.

completeLock boolean

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.

ignoreDeletionError boolean

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.

policy string

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

vaultName string

The name of the Glacier Vault.

complete_lock bool

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.

ignore_deletion_error bool

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.

policy str

JSON string containing the IAM policy to apply as the Glacier Vault Lock policy.

vault_name str

The name of the Glacier Vault.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.