aws.redshift.SnapshotCopyGrant
Explore with Pulumi AI
Creates a snapshot copy grant that allows AWS Redshift to encrypt copied snapshots with a customer master key from AWS KMS in a destination region.
Note that the grant must exist in the destination region, and not in the region of the cluster.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.redshift.SnapshotCopyGrant("test", {snapshotCopyGrantName: "my-grant"});
const testCluster = new aws.redshift.Cluster("test", {snapshotCopy: {
destinationRegion: "us-east-2",
grantName: test.snapshotCopyGrantName,
}});
import pulumi
import pulumi_aws as aws
test = aws.redshift.SnapshotCopyGrant("test", snapshot_copy_grant_name="my-grant")
test_cluster = aws.redshift.Cluster("test", snapshot_copy={
"destination_region": "us-east-2",
"grant_name": test.snapshot_copy_grant_name,
})
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshift"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := redshift.NewSnapshotCopyGrant(ctx, "test", &redshift.SnapshotCopyGrantArgs{
SnapshotCopyGrantName: pulumi.String("my-grant"),
})
if err != nil {
return err
}
_, err = redshift.NewCluster(ctx, "test", &redshift.ClusterArgs{
SnapshotCopy: &redshift.ClusterSnapshotCopyArgs{
DestinationRegion: pulumi.String("us-east-2"),
GrantName: test.SnapshotCopyGrantName,
},
})
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 test = new Aws.RedShift.SnapshotCopyGrant("test", new()
{
SnapshotCopyGrantName = "my-grant",
});
var testCluster = new Aws.RedShift.Cluster("test", new()
{
SnapshotCopy = new Aws.RedShift.Inputs.ClusterSnapshotCopyArgs
{
DestinationRegion = "us-east-2",
GrantName = test.SnapshotCopyGrantName,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshift.SnapshotCopyGrant;
import com.pulumi.aws.redshift.SnapshotCopyGrantArgs;
import com.pulumi.aws.redshift.Cluster;
import com.pulumi.aws.redshift.ClusterArgs;
import com.pulumi.aws.redshift.inputs.ClusterSnapshotCopyArgs;
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 test = new SnapshotCopyGrant("test", SnapshotCopyGrantArgs.builder()
.snapshotCopyGrantName("my-grant")
.build());
var testCluster = new Cluster("testCluster", ClusterArgs.builder()
.snapshotCopy(ClusterSnapshotCopyArgs.builder()
.destinationRegion("us-east-2")
.grantName(test.snapshotCopyGrantName())
.build())
.build());
}
}
resources:
test:
type: aws:redshift:SnapshotCopyGrant
properties:
snapshotCopyGrantName: my-grant
testCluster:
type: aws:redshift:Cluster
name: test
properties:
snapshotCopy:
destinationRegion: us-east-2
grantName: ${test.snapshotCopyGrantName}
Create SnapshotCopyGrant Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SnapshotCopyGrant(name: string, args: SnapshotCopyGrantArgs, opts?: CustomResourceOptions);
@overload
def SnapshotCopyGrant(resource_name: str,
args: SnapshotCopyGrantArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SnapshotCopyGrant(resource_name: str,
opts: Optional[ResourceOptions] = None,
snapshot_copy_grant_name: Optional[str] = None,
kms_key_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewSnapshotCopyGrant(ctx *Context, name string, args SnapshotCopyGrantArgs, opts ...ResourceOption) (*SnapshotCopyGrant, error)
public SnapshotCopyGrant(string name, SnapshotCopyGrantArgs args, CustomResourceOptions? opts = null)
public SnapshotCopyGrant(String name, SnapshotCopyGrantArgs args)
public SnapshotCopyGrant(String name, SnapshotCopyGrantArgs args, CustomResourceOptions options)
type: aws:redshift:SnapshotCopyGrant
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 SnapshotCopyGrantArgs
- 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 SnapshotCopyGrantArgs
- 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 SnapshotCopyGrantArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SnapshotCopyGrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SnapshotCopyGrantArgs
- 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 snapshotCopyGrantResource = new Aws.RedShift.SnapshotCopyGrant("snapshotCopyGrantResource", new()
{
SnapshotCopyGrantName = "string",
KmsKeyId = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := redshift.NewSnapshotCopyGrant(ctx, "snapshotCopyGrantResource", &redshift.SnapshotCopyGrantArgs{
SnapshotCopyGrantName: pulumi.String("string"),
KmsKeyId: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var snapshotCopyGrantResource = new SnapshotCopyGrant("snapshotCopyGrantResource", SnapshotCopyGrantArgs.builder()
.snapshotCopyGrantName("string")
.kmsKeyId("string")
.tags(Map.of("string", "string"))
.build());
snapshot_copy_grant_resource = aws.redshift.SnapshotCopyGrant("snapshotCopyGrantResource",
snapshot_copy_grant_name="string",
kms_key_id="string",
tags={
"string": "string",
})
const snapshotCopyGrantResource = new aws.redshift.SnapshotCopyGrant("snapshotCopyGrantResource", {
snapshotCopyGrantName: "string",
kmsKeyId: "string",
tags: {
string: "string",
},
});
type: aws:redshift:SnapshotCopyGrant
properties:
kmsKeyId: string
snapshotCopyGrantName: string
tags:
string: string
SnapshotCopyGrant 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 SnapshotCopyGrant resource accepts the following input properties:
- Snapshot
Copy stringGrant Name - A friendly name for identifying the grant.
- Kms
Key stringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- 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.
- Snapshot
Copy stringGrant Name - A friendly name for identifying the grant.
- Kms
Key stringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- 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.
- snapshot
Copy StringGrant Name - A friendly name for identifying the grant.
- kms
Key StringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- 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.
- snapshot
Copy stringGrant Name - A friendly name for identifying the grant.
- kms
Key stringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- {[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.
- snapshot_
copy_ strgrant_ name - A friendly name for identifying the grant.
- kms_
key_ strid - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- 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.
- snapshot
Copy StringGrant Name - A friendly name for identifying the grant.
- kms
Key StringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- 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 SnapshotCopyGrant resource produces the following output properties:
Look up Existing SnapshotCopyGrant Resource
Get an existing SnapshotCopyGrant 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?: SnapshotCopyGrantState, opts?: CustomResourceOptions): SnapshotCopyGrant
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
kms_key_id: Optional[str] = None,
snapshot_copy_grant_name: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> SnapshotCopyGrant
func GetSnapshotCopyGrant(ctx *Context, name string, id IDInput, state *SnapshotCopyGrantState, opts ...ResourceOption) (*SnapshotCopyGrant, error)
public static SnapshotCopyGrant Get(string name, Input<string> id, SnapshotCopyGrantState? state, CustomResourceOptions? opts = null)
public static SnapshotCopyGrant get(String name, Output<String> id, SnapshotCopyGrantState 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.
- Arn string
- Amazon Resource Name (ARN) of snapshot copy grant
- Kms
Key stringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- Snapshot
Copy stringGrant Name - A friendly name for identifying the grant.
- 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.
- Arn string
- Amazon Resource Name (ARN) of snapshot copy grant
- Kms
Key stringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- Snapshot
Copy stringGrant Name - A friendly name for identifying the grant.
- 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.
- arn String
- Amazon Resource Name (ARN) of snapshot copy grant
- kms
Key StringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- snapshot
Copy StringGrant Name - A friendly name for identifying the grant.
- 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.
- arn string
- Amazon Resource Name (ARN) of snapshot copy grant
- kms
Key stringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- snapshot
Copy stringGrant Name - A friendly name for identifying the grant.
- {[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.
- arn str
- Amazon Resource Name (ARN) of snapshot copy grant
- kms_
key_ strid - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- snapshot_
copy_ strgrant_ name - A friendly name for identifying the grant.
- 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.
- arn String
- Amazon Resource Name (ARN) of snapshot copy grant
- kms
Key StringId - The unique identifier for the customer master key (CMK) that the grant applies to. Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify a CMK in a different AWS account, you must use the key ARN. If not specified, the default key is used.
- snapshot
Copy StringGrant Name - A friendly name for identifying the grant.
- 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.
Import
Using pulumi import
, import Redshift Snapshot Copy Grants by name. For example:
$ pulumi import aws:redshift/snapshotCopyGrant:SnapshotCopyGrant test my-grant
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.