AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

CloudFormationStack

Deploys an Application CloudFormation Stack from the Serverless Application Repository.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var currentPartition = Output.Create(Aws.GetPartition.InvokeAsync());
        var currentRegion = Output.Create(Aws.GetRegion.InvokeAsync());
        var postgres_rotator = new Aws.ServerlessRepository.CloudFormationStack("postgres-rotator", new Aws.ServerlessRepository.CloudFormationStackArgs
        {
            ApplicationId = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
            Capabilities = 
            {
                "CAPABILITY_IAM",
                "CAPABILITY_RESOURCE_POLICY",
            },
            Parameters = 
            {
                { "endpoint", Output.Tuple(currentRegion, currentPartition).Apply(values =>
                {
                    var currentRegion = values.Item1;
                    var currentPartition = values.Item2;
                    return $"secretsmanager.{currentRegion.Name}.{currentPartition.DnsSuffix}";
                }) },
                { "functionName", "func-postgres-rotator" },
            },
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/serverlessrepository"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		currentPartition, err := aws.GetPartition(ctx, nil, nil)
		if err != nil {
			return err
		}
		currentRegion, err := aws.GetRegion(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = serverlessrepository.NewCloudFormationStack(ctx, "postgres-rotator", &serverlessrepository.CloudFormationStackArgs{
			ApplicationId: pulumi.String("arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"),
			Capabilities: pulumi.StringArray{
				pulumi.String("CAPABILITY_IAM"),
				pulumi.String("CAPABILITY_RESOURCE_POLICY"),
			},
			Parameters: pulumi.StringMap{
				"endpoint":     pulumi.String(fmt.Sprintf("%v%v%v%v", "secretsmanager.", currentRegion.Name, ".", currentPartition.DnsSuffix)),
				"functionName": pulumi.String("func-postgres-rotator"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var currentPartition = Output.of(AwsFunctions.getPartition());

        final var currentRegion = Output.of(AwsFunctions.getRegion());

        var postgres_rotator = new CloudFormationStack("postgres-rotator", CloudFormationStackArgs.builder()        
            .applicationId("arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser")
            .capabilities(            
                "CAPABILITY_IAM",
                "CAPABILITY_RESOURCE_POLICY")
            .parameters(Map.ofEntries(
                Map.entry("endpoint", String.format("secretsmanager.%s.%s", currentRegion.apply(getRegionResult -> getRegionResult.getName()),currentPartition.apply(getPartitionResult -> getPartitionResult.getDnsSuffix()))),
                Map.entry("functionName", "func-postgres-rotator")
            ))
            .build());

        }
}
import pulumi
import pulumi_aws as aws

current_partition = aws.get_partition()
current_region = aws.get_region()
postgres_rotator = aws.serverlessrepository.CloudFormationStack("postgres-rotator",
    application_id="arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
    capabilities=[
        "CAPABILITY_IAM",
        "CAPABILITY_RESOURCE_POLICY",
    ],
    parameters={
        "endpoint": f"secretsmanager.{current_region.name}.{current_partition.dns_suffix}",
        "functionName": "func-postgres-rotator",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const currentPartition = pulumi.output(aws.getPartition());
const currentRegion = pulumi.output(aws.getRegion());
const postgres_rotator = new aws.serverlessrepository.CloudFormationStack("postgres-rotator", {
    applicationId: "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
    capabilities: [
        "CAPABILITY_IAM",
        "CAPABILITY_RESOURCE_POLICY",
    ],
    parameters: {
        endpoint: pulumi.interpolate`secretsmanager.${currentRegion.name!}.${currentPartition.dnsSuffix}`,
        functionName: "func-postgres-rotator",
    },
});
resources:
  postgres-rotator:
    type: aws:serverlessrepository:CloudFormationStack
    properties:
      applicationId: arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser
      capabilities:
        - CAPABILITY_IAM
        - CAPABILITY_RESOURCE_POLICY
      parameters:
        endpoint: secretsmanager.${currentRegion.name}.${currentPartition.dnsSuffix}
        functionName: func-postgres-rotator
variables:
  currentPartition:
    Fn::Invoke:
      Function: aws:getPartition
      Arguments: {}
  currentRegion:
    Fn::Invoke:
      Function: aws:getRegion
      Arguments: {}

Create a CloudFormationStack Resource

new CloudFormationStack(name: string, args: CloudFormationStackArgs, opts?: CustomResourceOptions);
@overload
def CloudFormationStack(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        application_id: Optional[str] = None,
                        capabilities: Optional[Sequence[str]] = None,
                        name: Optional[str] = None,
                        parameters: Optional[Mapping[str, str]] = None,
                        semantic_version: Optional[str] = None,
                        tags: Optional[Mapping[str, str]] = None)
@overload
def CloudFormationStack(resource_name: str,
                        args: CloudFormationStackArgs,
                        opts: Optional[ResourceOptions] = None)
func NewCloudFormationStack(ctx *Context, name string, args CloudFormationStackArgs, opts ...ResourceOption) (*CloudFormationStack, error)
public CloudFormationStack(string name, CloudFormationStackArgs args, CustomResourceOptions? opts = null)
public CloudFormationStack(String name, CloudFormationStackArgs args)
public CloudFormationStack(String name, CloudFormationStackArgs args, CustomResourceOptions options)
type: aws:serverlessrepository:CloudFormationStack
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

CloudFormationStack 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 CloudFormationStack resource accepts the following input properties:

ApplicationId string

The ARN of the application from the Serverless Application Repository.

Capabilities List<string>

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

Name string

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

Parameters Dictionary<string, string>

A map of Parameter structures that specify input parameters for the stack.

SemanticVersion string

The version of the application to deploy. If not supplied, deploys the latest version.

Tags Dictionary<string, string>

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

ApplicationId string

The ARN of the application from the Serverless Application Repository.

Capabilities []string

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

Name string

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

Parameters map[string]string

A map of Parameter structures that specify input parameters for the stack.

SemanticVersion string

The version of the application to deploy. If not supplied, deploys the latest version.

Tags map[string]string

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

applicationId String

The ARN of the application from the Serverless Application Repository.

capabilities List

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name String

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

parameters Map

A map of Parameter structures that specify input parameters for the stack.

semanticVersion String

The version of the application to deploy. If not supplied, deploys the latest version.

tags Map

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

applicationId string

The ARN of the application from the Serverless Application Repository.

capabilities string[]

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name string

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

parameters {[key: string]: string}

A map of Parameter structures that specify input parameters for the stack.

semanticVersion string

The version of the application to deploy. If not supplied, deploys the latest version.

tags {[key: string]: string}

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

application_id str

The ARN of the application from the Serverless Application Repository.

capabilities Sequence[str]

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name str

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

parameters Mapping[str, str]

A map of Parameter structures that specify input parameters for the stack.

semantic_version str

The version of the application to deploy. If not supplied, deploys the latest version.

tags Mapping[str, str]

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

applicationId String

The ARN of the application from the Serverless Application Repository.

capabilities List

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name String

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

parameters Map

A map of Parameter structures that specify input parameters for the stack.

semanticVersion String

The version of the application to deploy. If not supplied, deploys the latest version.

tags Map

A list of tags to associate with this stack. .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 CloudFormationStack resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Outputs Dictionary<string, string>

A map of outputs from the stack.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider .

Id string

The provider-assigned unique ID for this managed resource.

Outputs map[string]string

A map of outputs from the stack.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider .

id String

The provider-assigned unique ID for this managed resource.

outputs Map

A map of outputs from the stack.

tagsAll Map

A map of tags assigned to the resource, including those inherited from the provider .

id string

The provider-assigned unique ID for this managed resource.

outputs {[key: string]: string}

A map of outputs from the stack.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider .

id str

The provider-assigned unique ID for this managed resource.

outputs Mapping[str, str]

A map of outputs from the stack.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider .

id String

The provider-assigned unique ID for this managed resource.

outputs Map

A map of outputs from the stack.

tagsAll Map

A map of tags assigned to the resource, including those inherited from the provider .

Look up an Existing CloudFormationStack Resource

Get an existing CloudFormationStack 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?: CloudFormationStackState, opts?: CustomResourceOptions): CloudFormationStack
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        application_id: Optional[str] = None,
        capabilities: Optional[Sequence[str]] = None,
        name: Optional[str] = None,
        outputs: Optional[Mapping[str, str]] = None,
        parameters: Optional[Mapping[str, str]] = None,
        semantic_version: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> CloudFormationStack
func GetCloudFormationStack(ctx *Context, name string, id IDInput, state *CloudFormationStackState, opts ...ResourceOption) (*CloudFormationStack, error)
public static CloudFormationStack Get(string name, Input<string> id, CloudFormationStackState? state, CustomResourceOptions? opts = null)
public static CloudFormationStack get(String name, Output<String> id, CloudFormationStackState 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:
ApplicationId string

The ARN of the application from the Serverless Application Repository.

Capabilities List<string>

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

Name string

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

Outputs Dictionary<string, string>

A map of outputs from the stack.

Parameters Dictionary<string, string>

A map of Parameter structures that specify input parameters for the stack.

SemanticVersion string

The version of the application to deploy. If not supplied, deploys the latest version.

Tags Dictionary<string, string>

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider .

ApplicationId string

The ARN of the application from the Serverless Application Repository.

Capabilities []string

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

Name string

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

Outputs map[string]string

A map of outputs from the stack.

Parameters map[string]string

A map of Parameter structures that specify input parameters for the stack.

SemanticVersion string

The version of the application to deploy. If not supplied, deploys the latest version.

Tags map[string]string

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider .

applicationId String

The ARN of the application from the Serverless Application Repository.

capabilities List

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name String

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

outputs Map

A map of outputs from the stack.

parameters Map

A map of Parameter structures that specify input parameters for the stack.

semanticVersion String

The version of the application to deploy. If not supplied, deploys the latest version.

tags Map

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map

A map of tags assigned to the resource, including those inherited from the provider .

applicationId string

The ARN of the application from the Serverless Application Repository.

capabilities string[]

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name string

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

outputs {[key: string]: string}

A map of outputs from the stack.

parameters {[key: string]: string}

A map of Parameter structures that specify input parameters for the stack.

semanticVersion string

The version of the application to deploy. If not supplied, deploys the latest version.

tags {[key: string]: string}

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider .

application_id str

The ARN of the application from the Serverless Application Repository.

capabilities Sequence[str]

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name str

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

outputs Mapping[str, str]

A map of outputs from the stack.

parameters Mapping[str, str]

A map of Parameter structures that specify input parameters for the stack.

semantic_version str

The version of the application to deploy. If not supplied, deploys the latest version.

tags Mapping[str, str]

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider .

applicationId String

The ARN of the application from the Serverless Application Repository.

capabilities List

A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND

name String

The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo-

outputs Map

A map of outputs from the stack.

parameters Map

A map of Parameter structures that specify input parameters for the stack.

semanticVersion String

The version of the application to deploy. If not supplied, deploys the latest version.

tags Map

A list of tags to associate with this stack. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map

A map of tags assigned to the resource, including those inherited from the provider .

Import

Serverless Application Repository Stack can be imported using the CloudFormation Stack name (with or without the serverlessrepo- prefix) or the CloudFormation Stack ID, e.g.,

 $ pulumi import aws:serverlessrepository/cloudFormationStack:CloudFormationStack example serverlessrepo-postgres-rotator

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.