Cloud Formation Stack
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}`),
},
});
Content copied to clipboard
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}",
})
Content copied to clipboard
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)}";
}) },
},
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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(GetPartitionArgs.builder()
.build());
final var currentGetRegion = AwsFunctions.getRegion(GetRegionArgs.builder()
.build());
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.name(),current.dnsSuffix()))
))
.build());
}
}
Content copied to clipboard
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: {}
Content copied to clipboard
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
Content copied to clipboard
Properties
Link copied to clipboard
The ARN of the application from the Serverless Application Repository.
Link copied to clipboard
A list of capabilities. Valid values are CAPABILITY_IAM
, CAPABILITY_NAMED_IAM
, CAPABILITY_RESOURCE_POLICY
, or CAPABILITY_AUTO_EXPAND
Link copied to clipboard
A map of Parameter structures that specify input parameters for the stack.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The version of the application to deploy. If not supplied, deploys the latest version.