aws logo
AWS Classic v5.28.0, Jan 23 23

aws.redshift.SnapshotScheduleAssociation

Import

Redshift Snapshot Schedule Association can be imported using the <cluster-identifier>/<schedule-identifier>, e.g.,

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

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

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

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

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

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/redshift"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultCluster, err := redshift.NewCluster(ctx, "defaultCluster", &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, "defaultSnapshotSchedule", &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, "defaultSnapshotScheduleAssociation", &redshift.SnapshotScheduleAssociationArgs{
			ClusterIdentifier:  defaultCluster.ID(),
			ScheduleIdentifier: defaultSnapshotSchedule.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 defaultCluster = new Cluster("defaultCluster", 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(defaultCluster.id())
            .scheduleIdentifier(defaultSnapshotSchedule.id())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

default_cluster = aws.redshift.Cluster("defaultCluster",
    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("defaultSnapshotSchedule",
    identifier="tf-redshift-snapshot-schedule",
    definitions=["rate(12 hours)"])
default_snapshot_schedule_association = aws.redshift.SnapshotScheduleAssociation("defaultSnapshotScheduleAssociation",
    cluster_identifier=default_cluster.id,
    schedule_identifier=default_snapshot_schedule.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const defaultCluster = new aws.redshift.Cluster("defaultCluster", {
    clusterIdentifier: "tf-redshift-cluster",
    databaseName: "mydb",
    masterUsername: "foo",
    masterPassword: "Mustbe8characters",
    nodeType: "dc1.large",
    clusterType: "single-node",
});
const defaultSnapshotSchedule = new aws.redshift.SnapshotSchedule("defaultSnapshotSchedule", {
    identifier: "tf-redshift-snapshot-schedule",
    definitions: ["rate(12 hours)"],
});
const defaultSnapshotScheduleAssociation = new aws.redshift.SnapshotScheduleAssociation("defaultSnapshotScheduleAssociation", {
    clusterIdentifier: defaultCluster.id,
    scheduleIdentifier: defaultSnapshotSchedule.id,
});
resources:
  defaultCluster:
    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
    properties:
      identifier: tf-redshift-snapshot-schedule
      definitions:
        - rate(12 hours)
  defaultSnapshotScheduleAssociation:
    type: aws:redshift:SnapshotScheduleAssociation
    properties:
      clusterIdentifier: ${defaultCluster.id}
      scheduleIdentifier: ${defaultSnapshotSchedule.id}

Create SnapshotScheduleAssociation Resource

new SnapshotScheduleAssociation(name: string, args: SnapshotScheduleAssociationArgs, opts?: CustomResourceOptions);
@overload
def SnapshotScheduleAssociation(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                cluster_identifier: Optional[str] = None,
                                schedule_identifier: Optional[str] = None)
@overload
def SnapshotScheduleAssociation(resource_name: str,
                                args: SnapshotScheduleAssociationArgs,
                                opts: Optional[ResourceOptions] = 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.

name string
The unique name of the resource.
args SnapshotScheduleAssociationArgs
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 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 string
The unique name of the resource.
args SnapshotScheduleAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SnapshotScheduleAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SnapshotScheduleAssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The SnapshotScheduleAssociation resource accepts the following input properties:

ClusterIdentifier string

The cluster identifier.

ScheduleIdentifier string

The snapshot schedule identifier.

ClusterIdentifier string

The cluster identifier.

ScheduleIdentifier string

The snapshot schedule identifier.

clusterIdentifier String

The cluster identifier.

scheduleIdentifier String

The snapshot schedule identifier.

clusterIdentifier string

The cluster identifier.

scheduleIdentifier string

The snapshot schedule identifier.

cluster_identifier str

The cluster identifier.

schedule_identifier str

The snapshot schedule identifier.

clusterIdentifier String

The cluster identifier.

scheduleIdentifier 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)
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.
The following state arguments are supported:
ClusterIdentifier string

The cluster identifier.

ScheduleIdentifier string

The snapshot schedule identifier.

ClusterIdentifier string

The cluster identifier.

ScheduleIdentifier string

The snapshot schedule identifier.

clusterIdentifier String

The cluster identifier.

scheduleIdentifier String

The snapshot schedule identifier.

clusterIdentifier string

The cluster identifier.

scheduleIdentifier string

The snapshot schedule identifier.

cluster_identifier str

The cluster identifier.

schedule_identifier str

The snapshot schedule identifier.

clusterIdentifier String

The cluster identifier.

scheduleIdentifier String

The snapshot schedule identifier.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.