aws.serverlessrepository.CloudFormationStack
Explore with Pulumi AI
Deploys an Application CloudFormation Stack from the Serverless Application Repository.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getPartition({});
const currentGetRegion = aws.getRegion({});
const postgres_rotator = new aws.serverlessrepository.CloudFormationStack("postgres-rotator", {
    name: "postgres-rotator",
    applicationId: "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
    capabilities: [
        "CAPABILITY_IAM",
        "CAPABILITY_RESOURCE_POLICY",
    ],
    parameters: {
        functionName: "func-postgres-rotator",
        endpoint: Promise.all([currentGetRegion, current]).then(([currentGetRegion, current]) => `secretsmanager.${currentGetRegion.name}.${current.dnsSuffix}`),
    },
});
import pulumi
import pulumi_aws as aws
current = aws.get_partition()
current_get_region = aws.get_region()
postgres_rotator = aws.serverlessrepository.CloudFormationStack("postgres-rotator",
    name="postgres-rotator",
    application_id="arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
    capabilities=[
        "CAPABILITY_IAM",
        "CAPABILITY_RESOURCE_POLICY",
    ],
    parameters={
        "functionName": "func-postgres-rotator",
        "endpoint": f"secretsmanager.{current_get_region.name}.{current.dns_suffix}",
    })
package main
import (
	"fmt"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/serverlessrepository"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		current, err := aws.GetPartition(ctx, &aws.GetPartitionArgs{}, nil)
		if err != nil {
			return err
		}
		currentGetRegion, err := aws.GetRegion(ctx, &aws.GetRegionArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = serverlessrepository.NewCloudFormationStack(ctx, "postgres-rotator", &serverlessrepository.CloudFormationStackArgs{
			Name:          pulumi.String("postgres-rotator"),
			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{
				"functionName": pulumi.String("func-postgres-rotator"),
				"endpoint":     pulumi.Sprintf("secretsmanager.%v.%v", currentGetRegion.Name, current.DnsSuffix),
			},
		})
		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 current = Aws.GetPartition.Invoke();
    var currentGetRegion = Aws.GetRegion.Invoke();
    var postgres_rotator = new Aws.ServerlessRepository.CloudFormationStack("postgres-rotator", new()
    {
        Name = "postgres-rotator",
        ApplicationId = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
        Capabilities = new[]
        {
            "CAPABILITY_IAM",
            "CAPABILITY_RESOURCE_POLICY",
        },
        Parameters = 
        {
            { "functionName", "func-postgres-rotator" },
            { "endpoint", Output.Tuple(currentGetRegion, current).Apply(values =>
            {
                var currentGetRegion = values.Item1;
                var current = values.Item2;
                return $"secretsmanager.{currentGetRegion.Apply(getRegionResult => getRegionResult.Name)}.{current.Apply(getPartitionResult => getPartitionResult.DnsSuffix)}";
            }) },
        },
    });
});
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.GetPartitionArgs;
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 current = AwsFunctions.getPartition();
        final var currentGetRegion = AwsFunctions.getRegion();
        var postgres_rotator = new CloudFormationStack("postgres-rotator", CloudFormationStackArgs.builder()
            .name("postgres-rotator")
            .applicationId("arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser")
            .capabilities(            
                "CAPABILITY_IAM",
                "CAPABILITY_RESOURCE_POLICY")
            .parameters(Map.ofEntries(
                Map.entry("functionName", "func-postgres-rotator"),
                Map.entry("endpoint", String.format("secretsmanager.%s.%s", currentGetRegion.applyValue(getRegionResult -> getRegionResult.name()),current.applyValue(getPartitionResult -> getPartitionResult.dnsSuffix())))
            ))
            .build());
    }
}
resources:
  postgres-rotator:
    type: aws:serverlessrepository:CloudFormationStack
    properties:
      name: postgres-rotator
      applicationId: arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser
      capabilities:
        - CAPABILITY_IAM
        - CAPABILITY_RESOURCE_POLICY
      parameters:
        functionName: func-postgres-rotator
        endpoint: secretsmanager.${currentGetRegion.name}.${current.dnsSuffix}
variables:
  current:
    fn::invoke:
      function: aws:getPartition
      arguments: {}
  currentGetRegion:
    fn::invoke:
      function: aws:getRegion
      arguments: {}
Create CloudFormationStack Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CloudFormationStack(name: string, args: CloudFormationStackArgs, opts?: CustomResourceOptions);@overload
def CloudFormationStack(resource_name: str,
                        args: CloudFormationStackArgs,
                        opts: Optional[ResourceOptions] = None)
@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)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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var cloudFormationStackResource = new Aws.ServerlessRepository.CloudFormationStack("cloudFormationStackResource", new()
{
    ApplicationId = "string",
    Capabilities = new[]
    {
        "string",
    },
    Name = "string",
    Parameters = 
    {
        { "string", "string" },
    },
    SemanticVersion = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
example, err := serverlessrepository.NewCloudFormationStack(ctx, "cloudFormationStackResource", &serverlessrepository.CloudFormationStackArgs{
	ApplicationId: pulumi.String("string"),
	Capabilities: pulumi.StringArray{
		pulumi.String("string"),
	},
	Name: pulumi.String("string"),
	Parameters: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	SemanticVersion: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
var cloudFormationStackResource = new CloudFormationStack("cloudFormationStackResource", CloudFormationStackArgs.builder()
    .applicationId("string")
    .capabilities("string")
    .name("string")
    .parameters(Map.of("string", "string"))
    .semanticVersion("string")
    .tags(Map.of("string", "string"))
    .build());
cloud_formation_stack_resource = aws.serverlessrepository.CloudFormationStack("cloudFormationStackResource",
    application_id="string",
    capabilities=["string"],
    name="string",
    parameters={
        "string": "string",
    },
    semantic_version="string",
    tags={
        "string": "string",
    })
const cloudFormationStackResource = new aws.serverlessrepository.CloudFormationStack("cloudFormationStackResource", {
    applicationId: "string",
    capabilities: ["string"],
    name: "string",
    parameters: {
        string: "string",
    },
    semanticVersion: "string",
    tags: {
        string: "string",
    },
});
type: aws:serverlessrepository:CloudFormationStack
properties:
    applicationId: string
    capabilities:
        - string
    name: string
    parameters:
        string: string
    semanticVersion: string
    tags:
        string: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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, orCAPABILITY_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.
- Dictionary<string, string>
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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, orCAPABILITY_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.
- map[string]string
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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, orCAPABILITY_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.
- Map<String,String>
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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, orCAPABILITY_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.
- {[key: string]: string}
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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, orCAPABILITY_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.
- Mapping[str, str]
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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, orCAPABILITY_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.
- Map<String>
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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:
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) -> CloudFormationStackfunc 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)resources:  _:    type: aws:serverlessrepository:CloudFormationStack    get:      id: ${id}- 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.
- 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, orCAPABILITY_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.
- Dictionary<string, string>
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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_tagsconfiguration 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, orCAPABILITY_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.
- map[string]string
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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_tagsconfiguration 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, orCAPABILITY_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.
- Map<String,String>
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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_tagsconfiguration 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, orCAPABILITY_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.
- {[key: string]: string}
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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_tagsconfiguration 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, orCAPABILITY_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.
- Mapping[str, str]
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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_tagsconfiguration 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, orCAPABILITY_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.
- Map<String>
- A list of tags to associate with this stack. .If configured with a provider default_tagsconfiguration 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_tagsconfiguration block.
Import
Using pulumi import, import Serverless Application Repository Stack using the CloudFormation Stack name (with or without the serverlessrepo- prefix) or the CloudFormation Stack ID. For example:
$ pulumi import aws:serverlessrepository/cloudFormationStack:CloudFormationStack example serverlessrepo-postgres-rotator
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 awsTerraform Provider.