1. Packages
  2. AWS
  3. API Docs
  4. redshift
  5. SnapshotScheduleAssociation
AWS v6.75.0 published on Wednesday, Apr 2, 2025 by Pulumi

aws.redshift.SnapshotScheduleAssociation

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const _default = new aws.redshift.Cluster("default", {
    clusterIdentifier: "tf-redshift-cluster",
    databaseName: "mydb",
    masterUsername: "foo",
    masterPassword: "Mustbe8characters",
    nodeType: "dc1.large",
    clusterType: "single-node",
});
const defaultSnapshotSchedule = new aws.redshift.SnapshotSchedule("default", {
    identifier: "tf-redshift-snapshot-schedule",
    definitions: ["rate(12 hours)"],
});
const defaultSnapshotScheduleAssociation = new aws.redshift.SnapshotScheduleAssociation("default", {
    clusterIdentifier: _default.id,
    scheduleIdentifier: defaultSnapshotSchedule.id,
});
Copy
import pulumi
import pulumi_aws as aws

default = aws.redshift.Cluster("default",
    cluster_identifier="tf-redshift-cluster",
    database_name="mydb",
    master_username="foo",
    master_password="Mustbe8characters",
    node_type="dc1.large",
    cluster_type="single-node")
default_snapshot_schedule = aws.redshift.SnapshotSchedule("default",
    identifier="tf-redshift-snapshot-schedule",
    definitions=["rate(12 hours)"])
default_snapshot_schedule_association = aws.redshift.SnapshotScheduleAssociation("default",
    cluster_identifier=default.id,
    schedule_identifier=default_snapshot_schedule.id)
Copy
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 {
		_default, err := redshift.NewCluster(ctx, "default", &redshift.ClusterArgs{
			ClusterIdentifier: pulumi.String("tf-redshift-cluster"),
			DatabaseName:      pulumi.String("mydb"),
			MasterUsername:    pulumi.String("foo"),
			MasterPassword:    pulumi.String("Mustbe8characters"),
			NodeType:          pulumi.String("dc1.large"),
			ClusterType:       pulumi.String("single-node"),
		})
		if err != nil {
			return err
		}
		defaultSnapshotSchedule, err := redshift.NewSnapshotSchedule(ctx, "default", &redshift.SnapshotScheduleArgs{
			Identifier: pulumi.String("tf-redshift-snapshot-schedule"),
			Definitions: pulumi.StringArray{
				pulumi.String("rate(12 hours)"),
			},
		})
		if err != nil {
			return err
		}
		_, err = redshift.NewSnapshotScheduleAssociation(ctx, "default", &redshift.SnapshotScheduleAssociationArgs{
			ClusterIdentifier:  _default.ID(),
			ScheduleIdentifier: defaultSnapshotSchedule.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var @default = new Aws.RedShift.Cluster("default", new()
    {
        ClusterIdentifier = "tf-redshift-cluster",
        DatabaseName = "mydb",
        MasterUsername = "foo",
        MasterPassword = "Mustbe8characters",
        NodeType = "dc1.large",
        ClusterType = "single-node",
    });

    var defaultSnapshotSchedule = new Aws.RedShift.SnapshotSchedule("default", new()
    {
        Identifier = "tf-redshift-snapshot-schedule",
        Definitions = new[]
        {
            "rate(12 hours)",
        },
    });

    var defaultSnapshotScheduleAssociation = new Aws.RedShift.SnapshotScheduleAssociation("default", new()
    {
        ClusterIdentifier = @default.Id,
        ScheduleIdentifier = defaultSnapshotSchedule.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.redshift.Cluster;
import com.pulumi.aws.redshift.ClusterArgs;
import com.pulumi.aws.redshift.SnapshotSchedule;
import com.pulumi.aws.redshift.SnapshotScheduleArgs;
import com.pulumi.aws.redshift.SnapshotScheduleAssociation;
import com.pulumi.aws.redshift.SnapshotScheduleAssociationArgs;
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 default_ = new Cluster("default", ClusterArgs.builder()
            .clusterIdentifier("tf-redshift-cluster")
            .databaseName("mydb")
            .masterUsername("foo")
            .masterPassword("Mustbe8characters")
            .nodeType("dc1.large")
            .clusterType("single-node")
            .build());

        var defaultSnapshotSchedule = new SnapshotSchedule("defaultSnapshotSchedule", SnapshotScheduleArgs.builder()
            .identifier("tf-redshift-snapshot-schedule")
            .definitions("rate(12 hours)")
            .build());

        var defaultSnapshotScheduleAssociation = new SnapshotScheduleAssociation("defaultSnapshotScheduleAssociation", SnapshotScheduleAssociationArgs.builder()
            .clusterIdentifier(default_.id())
            .scheduleIdentifier(defaultSnapshotSchedule.id())
            .build());

    }
}
Copy
resources:
  default:
    type: aws:redshift:Cluster
    properties:
      clusterIdentifier: tf-redshift-cluster
      databaseName: mydb
      masterUsername: foo
      masterPassword: Mustbe8characters
      nodeType: dc1.large
      clusterType: single-node
  defaultSnapshotSchedule:
    type: aws:redshift:SnapshotSchedule
    name: default
    properties:
      identifier: tf-redshift-snapshot-schedule
      definitions:
        - rate(12 hours)
  defaultSnapshotScheduleAssociation:
    type: aws:redshift:SnapshotScheduleAssociation
    name: default
    properties:
      clusterIdentifier: ${default.id}
      scheduleIdentifier: ${defaultSnapshotSchedule.id}
Copy

Create SnapshotScheduleAssociation Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SnapshotScheduleAssociation(name: string, args: SnapshotScheduleAssociationArgs, opts?: CustomResourceOptions);
@overload
def SnapshotScheduleAssociation(resource_name: str,
                                args: SnapshotScheduleAssociationArgs,
                                opts: Optional[ResourceOptions] = None)

@overload
def SnapshotScheduleAssociation(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                cluster_identifier: Optional[str] = None,
                                schedule_identifier: Optional[str] = None)
func NewSnapshotScheduleAssociation(ctx *Context, name string, args SnapshotScheduleAssociationArgs, opts ...ResourceOption) (*SnapshotScheduleAssociation, error)
public SnapshotScheduleAssociation(string name, SnapshotScheduleAssociationArgs args, CustomResourceOptions? opts = null)
public SnapshotScheduleAssociation(String name, SnapshotScheduleAssociationArgs args)
public SnapshotScheduleAssociation(String name, SnapshotScheduleAssociationArgs args, CustomResourceOptions options)
type: aws:redshift:SnapshotScheduleAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SnapshotScheduleAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SnapshotScheduleAssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SnapshotScheduleAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SnapshotScheduleAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SnapshotScheduleAssociationArgs
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 snapshotScheduleAssociationResource = new Aws.RedShift.SnapshotScheduleAssociation("snapshotScheduleAssociationResource", new()
{
    ClusterIdentifier = "string",
    ScheduleIdentifier = "string",
});
Copy
example, err := redshift.NewSnapshotScheduleAssociation(ctx, "snapshotScheduleAssociationResource", &redshift.SnapshotScheduleAssociationArgs{
	ClusterIdentifier:  pulumi.String("string"),
	ScheduleIdentifier: pulumi.String("string"),
})
Copy
var snapshotScheduleAssociationResource = new SnapshotScheduleAssociation("snapshotScheduleAssociationResource", SnapshotScheduleAssociationArgs.builder()
    .clusterIdentifier("string")
    .scheduleIdentifier("string")
    .build());
Copy
snapshot_schedule_association_resource = aws.redshift.SnapshotScheduleAssociation("snapshotScheduleAssociationResource",
    cluster_identifier="string",
    schedule_identifier="string")
Copy
const snapshotScheduleAssociationResource = new aws.redshift.SnapshotScheduleAssociation("snapshotScheduleAssociationResource", {
    clusterIdentifier: "string",
    scheduleIdentifier: "string",
});
Copy
type: aws:redshift:SnapshotScheduleAssociation
properties:
    clusterIdentifier: string
    scheduleIdentifier: string
Copy

SnapshotScheduleAssociation Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SnapshotScheduleAssociation resource accepts the following input properties:

ClusterIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The cluster identifier.
ScheduleIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The snapshot schedule identifier.
ClusterIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The cluster identifier.
ScheduleIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The snapshot schedule identifier.
clusterIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The cluster identifier.
scheduleIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The snapshot schedule identifier.
clusterIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The cluster identifier.
scheduleIdentifier
This property is required.
Changes to this property will trigger replacement.
string
The snapshot schedule identifier.
cluster_identifier
This property is required.
Changes to this property will trigger replacement.
str
The cluster identifier.
schedule_identifier
This property is required.
Changes to this property will trigger replacement.
str
The snapshot schedule identifier.
clusterIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The cluster identifier.
scheduleIdentifier
This property is required.
Changes to this property will trigger replacement.
String
The snapshot schedule identifier.

Outputs

All input properties are implicitly available as output properties. Additionally, the SnapshotScheduleAssociation 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 string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing SnapshotScheduleAssociation Resource

Get an existing SnapshotScheduleAssociation 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?: SnapshotScheduleAssociationState, opts?: CustomResourceOptions): SnapshotScheduleAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_identifier: Optional[str] = None,
        schedule_identifier: Optional[str] = None) -> SnapshotScheduleAssociation
func GetSnapshotScheduleAssociation(ctx *Context, name string, id IDInput, state *SnapshotScheduleAssociationState, opts ...ResourceOption) (*SnapshotScheduleAssociation, error)
public static SnapshotScheduleAssociation Get(string name, Input<string> id, SnapshotScheduleAssociationState? state, CustomResourceOptions? opts = null)
public static SnapshotScheduleAssociation get(String name, Output<String> id, SnapshotScheduleAssociationState state, CustomResourceOptions options)
resources:  _:    type: aws:redshift:SnapshotScheduleAssociation    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ClusterIdentifier Changes to this property will trigger replacement. string
The cluster identifier.
ScheduleIdentifier Changes to this property will trigger replacement. string
The snapshot schedule identifier.
ClusterIdentifier Changes to this property will trigger replacement. string
The cluster identifier.
ScheduleIdentifier Changes to this property will trigger replacement. string
The snapshot schedule identifier.
clusterIdentifier Changes to this property will trigger replacement. String
The cluster identifier.
scheduleIdentifier Changes to this property will trigger replacement. String
The snapshot schedule identifier.
clusterIdentifier Changes to this property will trigger replacement. string
The cluster identifier.
scheduleIdentifier Changes to this property will trigger replacement. string
The snapshot schedule identifier.
cluster_identifier Changes to this property will trigger replacement. str
The cluster identifier.
schedule_identifier Changes to this property will trigger replacement. str
The snapshot schedule identifier.
clusterIdentifier Changes to this property will trigger replacement. String
The cluster identifier.
scheduleIdentifier Changes to this property will trigger replacement. String
The snapshot schedule identifier.

Import

Using pulumi import, import Redshift Snapshot Schedule Association using the <cluster-identifier>/<schedule-identifier>. For example:

$ pulumi import aws:redshift/snapshotScheduleAssociation:SnapshotScheduleAssociation default tf-redshift-cluster/tf-redshift-snapshot-schedule
Copy

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.