aws.glacier.Vault
Explore with Pulumi AI
Provides a Glacier Vault Resource. You can refer to the Glacier Developer Guide for a full explanation of the Glacier Vault functionality
NOTE: When removing a Glacier Vault, the Vault must be empty.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const awsSnsTopic = new aws.sns.Topic("aws_sns_topic", {name: "glacier-sns-topic"});
const myArchive = aws.iam.getPolicyDocument({
statements: [{
sid: "add-read-only-perm",
effect: "Allow",
principals: [{
type: "*",
identifiers: ["*"],
}],
actions: [
"glacier:InitiateJob",
"glacier:GetJobOutput",
],
resources: ["arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive"],
}],
});
const myArchiveVault = new aws.glacier.Vault("my_archive", {
name: "MyArchive",
notification: {
snsTopic: awsSnsTopic.arn,
events: [
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted",
],
},
accessPolicy: myArchive.then(myArchive => myArchive.json),
tags: {
Test: "MyArchive",
},
});
import pulumi
import pulumi_aws as aws
aws_sns_topic = aws.sns.Topic("aws_sns_topic", name="glacier-sns-topic")
my_archive = aws.iam.get_policy_document(statements=[{
"sid": "add-read-only-perm",
"effect": "Allow",
"principals": [{
"type": "*",
"identifiers": ["*"],
}],
"actions": [
"glacier:InitiateJob",
"glacier:GetJobOutput",
],
"resources": ["arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive"],
}])
my_archive_vault = aws.glacier.Vault("my_archive",
name="MyArchive",
notification={
"sns_topic": aws_sns_topic.arn,
"events": [
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted",
],
},
access_policy=my_archive.json,
tags={
"Test": "MyArchive",
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/glacier"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
awsSnsTopic, err := sns.NewTopic(ctx, "aws_sns_topic", &sns.TopicArgs{
Name: pulumi.String("glacier-sns-topic"),
})
if err != nil {
return err
}
myArchive, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
Statements: []iam.GetPolicyDocumentStatement{
{
Sid: pulumi.StringRef("add-read-only-perm"),
Effect: pulumi.StringRef("Allow"),
Principals: []iam.GetPolicyDocumentStatementPrincipal{
{
Type: "*",
Identifiers: []string{
"*",
},
},
},
Actions: []string{
"glacier:InitiateJob",
"glacier:GetJobOutput",
},
Resources: []string{
"arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive",
},
},
},
}, nil)
if err != nil {
return err
}
_, err = glacier.NewVault(ctx, "my_archive", &glacier.VaultArgs{
Name: pulumi.String("MyArchive"),
Notification: &glacier.VaultNotificationArgs{
SnsTopic: awsSnsTopic.Arn,
Events: pulumi.StringArray{
pulumi.String("ArchiveRetrievalCompleted"),
pulumi.String("InventoryRetrievalCompleted"),
},
},
AccessPolicy: pulumi.String(myArchive.Json),
Tags: pulumi.StringMap{
"Test": pulumi.String("MyArchive"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var awsSnsTopic = new Aws.Sns.Topic("aws_sns_topic", new()
{
Name = "glacier-sns-topic",
});
var myArchive = Aws.Iam.GetPolicyDocument.Invoke(new()
{
Statements = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
{
Sid = "add-read-only-perm",
Effect = "Allow",
Principals = new[]
{
new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
{
Type = "*",
Identifiers = new[]
{
"*",
},
},
},
Actions = new[]
{
"glacier:InitiateJob",
"glacier:GetJobOutput",
},
Resources = new[]
{
"arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive",
},
},
},
});
var myArchiveVault = new Aws.Glacier.Vault("my_archive", new()
{
Name = "MyArchive",
Notification = new Aws.Glacier.Inputs.VaultNotificationArgs
{
SnsTopic = awsSnsTopic.Arn,
Events = new[]
{
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted",
},
},
AccessPolicy = myArchive.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
Tags =
{
{ "Test", "MyArchive" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sns.Topic;
import com.pulumi.aws.sns.TopicArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.glacier.Vault;
import com.pulumi.aws.glacier.VaultArgs;
import com.pulumi.aws.glacier.inputs.VaultNotificationArgs;
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 awsSnsTopic = new Topic("awsSnsTopic", TopicArgs.builder()
.name("glacier-sns-topic")
.build());
final var myArchive = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.sid("add-read-only-perm")
.effect("Allow")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("*")
.identifiers("*")
.build())
.actions(
"glacier:InitiateJob",
"glacier:GetJobOutput")
.resources("arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive")
.build())
.build());
var myArchiveVault = new Vault("myArchiveVault", VaultArgs.builder()
.name("MyArchive")
.notification(VaultNotificationArgs.builder()
.snsTopic(awsSnsTopic.arn())
.events(
"ArchiveRetrievalCompleted",
"InventoryRetrievalCompleted")
.build())
.accessPolicy(myArchive.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
.tags(Map.of("Test", "MyArchive"))
.build());
}
}
resources:
awsSnsTopic:
type: aws:sns:Topic
name: aws_sns_topic
properties:
name: glacier-sns-topic
myArchiveVault:
type: aws:glacier:Vault
name: my_archive
properties:
name: MyArchive
notification:
snsTopic: ${awsSnsTopic.arn}
events:
- ArchiveRetrievalCompleted
- InventoryRetrievalCompleted
accessPolicy: ${myArchive.json}
tags:
Test: MyArchive
variables:
myArchive:
fn::invoke:
Function: aws:iam:getPolicyDocument
Arguments:
statements:
- sid: add-read-only-perm
effect: Allow
principals:
- type: '*'
identifiers:
- '*'
actions:
- glacier:InitiateJob
- glacier:GetJobOutput
resources:
- arn:aws:glacier:eu-west-1:432981146916:vaults/MyArchive
Create Vault Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Vault(name: string, args?: VaultArgs, opts?: CustomResourceOptions);
@overload
def Vault(resource_name: str,
args: Optional[VaultArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Vault(resource_name: str,
opts: Optional[ResourceOptions] = None,
access_policy: Optional[str] = None,
name: Optional[str] = None,
notification: Optional[VaultNotificationArgs] = None,
tags: Optional[Mapping[str, str]] = None)
func NewVault(ctx *Context, name string, args *VaultArgs, opts ...ResourceOption) (*Vault, error)
public Vault(string name, VaultArgs? args = null, CustomResourceOptions? opts = null)
type: aws:glacier:Vault
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VaultArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var awsVaultResource = new Aws.Glacier.Vault("awsVaultResource", new()
{
AccessPolicy = "string",
Name = "string",
Notification = new Aws.Glacier.Inputs.VaultNotificationArgs
{
Events = new[]
{
"string",
},
SnsTopic = "string",
},
Tags =
{
{ "string", "string" },
},
});
example, err := glacier.NewVault(ctx, "awsVaultResource", &glacier.VaultArgs{
AccessPolicy: pulumi.String("string"),
Name: pulumi.String("string"),
Notification: &glacier.VaultNotificationArgs{
Events: pulumi.StringArray{
pulumi.String("string"),
},
SnsTopic: pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var awsVaultResource = new Vault("awsVaultResource", VaultArgs.builder()
.accessPolicy("string")
.name("string")
.notification(VaultNotificationArgs.builder()
.events("string")
.snsTopic("string")
.build())
.tags(Map.of("string", "string"))
.build());
aws_vault_resource = aws.glacier.Vault("awsVaultResource",
access_policy="string",
name="string",
notification={
"events": ["string"],
"snsTopic": "string",
},
tags={
"string": "string",
})
const awsVaultResource = new aws.glacier.Vault("awsVaultResource", {
accessPolicy: "string",
name: "string",
notification: {
events: ["string"],
snsTopic: "string",
},
tags: {
string: "string",
},
});
type: aws:glacier:Vault
properties:
accessPolicy: string
name: string
notification:
events:
- string
snsTopic: string
tags:
string: string
Vault Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Vault resource accepts the following input properties:
- Access
Policy string - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - Name string
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- Notification
Vault
Notification - The notifications for the Vault. Fields documented below.
- Dictionary<string, string>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Access
Policy string - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - Name string
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- Notification
Vault
Notification Args - The notifications for the Vault. Fields documented below.
- map[string]string
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access
Policy String - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - name String
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification
Vault
Notification - The notifications for the Vault. Fields documented below.
- Map<String,String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access
Policy string - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - name string
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification
Vault
Notification - The notifications for the Vault. Fields documented below.
- {[key: string]: string}
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access_
policy str - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - name str
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification
Vault
Notification Args - The notifications for the Vault. Fields documented below.
- Mapping[str, str]
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- access
Policy String - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - name String
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification Property Map
- The notifications for the Vault. Fields documented below.
- Map<String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the Vault resource produces the following output properties:
Look up Existing Vault Resource
Get an existing Vault 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?: VaultState, opts?: CustomResourceOptions): Vault
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_policy: Optional[str] = None,
arn: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
notification: Optional[VaultNotificationArgs] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> Vault
func GetVault(ctx *Context, name string, id IDInput, state *VaultState, opts ...ResourceOption) (*Vault, error)
public static Vault Get(string name, Input<string> id, VaultState? state, CustomResourceOptions? opts = null)
public static Vault get(String name, Output<String> id, VaultState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Access
Policy string - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - Arn string
- The ARN of the vault.
- Location string
- The URI of the vault that was created.
- Name string
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- Notification
Vault
Notification - The notifications for the Vault. Fields documented below.
- Dictionary<string, string>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Access
Policy string - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - Arn string
- The ARN of the vault.
- Location string
- The URI of the vault that was created.
- Name string
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- Notification
Vault
Notification Args - The notifications for the Vault. Fields documented below.
- map[string]string
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Policy String - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - arn String
- The ARN of the vault.
- location String
- The URI of the vault that was created.
- name String
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification
Vault
Notification - The notifications for the Vault. Fields documented below.
- Map<String,String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Policy string - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - arn string
- The ARN of the vault.
- location string
- The URI of the vault that was created.
- name string
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification
Vault
Notification - The notifications for the Vault. Fields documented below.
- {[key: string]: string}
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access_
policy str - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - arn str
- The ARN of the vault.
- location str
- The URI of the vault that was created.
- name str
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification
Vault
Notification Args - The notifications for the Vault. Fields documented below.
- Mapping[str, str]
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- access
Policy String - The policy document. This is a JSON formatted string.
The heredoc syntax or
file
function is helpful here. Use the Glacier Developer Guide for more information on Glacier Vault Policy - arn String
- The ARN of the vault.
- location String
- The URI of the vault that was created.
- name String
- The name of the Vault. Names can be between 1 and 255 characters long and the valid characters are a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), and '.' (period).
- notification Property Map
- The notifications for the Vault. Fields documented below.
- Map<String>
- A map of tags to assign to the resource. .If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
VaultNotification, VaultNotificationArgs
Import
Using pulumi import
, import Glacier Vaults using the name
. For example:
$ pulumi import aws:glacier/vault:Vault archive my_archive
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.