aws logo
AWS Classic v5.41.0, May 15 23

aws.serverlessrepository.CloudFormationStack

Explore with Pulumi AI

Deploys an Application CloudFormation Stack from the Serverless Application Repository.

Example Usage

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

return await Deployment.RunAsync(() => 
{
    var currentPartition = Aws.GetPartition.Invoke();

    var currentRegion = Aws.GetRegion.Invoke();

    var postgres_rotator = new Aws.ServerlessRepository.CloudFormationStack("postgres-rotator", new()
    {
        ApplicationId = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
        Capabilities = new[]
        {
            "CAPABILITY_IAM",
            "CAPABILITY_RESOURCE_POLICY",
        },
        Parameters = 
        {
            { "endpoint", Output.Tuple(currentRegion, currentPartition).Apply(values =>
            {
                var currentRegion = values.Item1;
                var currentPartition = values.Item2;
                return $"secretsmanager.{currentRegion.Apply(getRegionResult => getRegionResult.Name)}.{currentPartition.Apply(getPartitionResult => getPartitionResult.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("secretsmanager.%v.%v", currentRegion.Name, currentPartition.DnsSuffix)),
				"functionName": pulumi.String("func-postgres-rotator"),
			},
		})
		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.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
import com.pulumi.aws.serverlessrepository.CloudFormationStack;
import com.pulumi.aws.serverlessrepository.CloudFormationStackArgs;
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) {
        final var currentPartition = AwsFunctions.getPartition();

        final var currentRegion = 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.applyValue(getRegionResult -> getRegionResult.name()),currentPartition.applyValue(getPartitionResult -> getPartitionResult.dnsSuffix()))),
                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 = aws.getPartition({});
const currentRegion = 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: Promise.all([currentRegion, currentPartition]).then(([currentRegion, currentPartition]) => `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 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<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 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<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>

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>

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 default_tags configuration block.

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 default_tags configuration block.

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 default_tags configuration block.

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 default_tags configuration block.

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 default_tags configuration block.

id String

The provider-assigned unique ID for this managed resource.

outputs Map<String>

A map of outputs from the stack.

tagsAll Map<String>

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

Look up 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 default_tags configuration block.

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 default_tags configuration block.

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 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 default_tags configuration block.

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 default_tags configuration block.

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 default_tags configuration block.

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 Map<String>

A map of outputs from the stack.

parameters Map<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>

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>

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

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
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.