VaultLockArgs

data class VaultLockArgs(val completeLock: Output<Boolean>? = null, val ignoreDeletionError: Output<Boolean>? = null, val policy: Output<String>? = null, val vaultName: Output<String>? = null) : ConvertibleToJava<VaultLockArgs>

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

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

Constructors

Link copied to clipboard
constructor(completeLock: Output<Boolean>? = null, ignoreDeletionError: Output<Boolean>? = null, policy: Output<String>? = null, vaultName: Output<String>? = null)

Properties

Link copied to clipboard
val completeLock: Output<Boolean>? = null

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.

Link copied to clipboard
val ignoreDeletionError: Output<Boolean>? = null

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.

Link copied to clipboard
val policy: Output<String>? = null

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

Link copied to clipboard
val vaultName: Output<String>? = null

The name of the Glacier Vault.

Functions

Link copied to clipboard
open override fun toJava(): VaultLockArgs