Skip to content

Resource: awsServerlessapplicationrepositoryCloudformationStack

Deploys an Application CloudFormation Stack from the Serverless Application Repository.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsPartitionCurrent = new aws.dataAwsPartition.DataAwsPartition(
  this,
  "current",
  {}
);
const dataAwsRegionCurrent = new aws.dataAwsRegion.DataAwsRegion(
  this,
  "current_1",
  {}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAwsRegionCurrent.overrideLogicalId("current");
new aws.serverlessapplicationrepositoryCloudformationStack.ServerlessapplicationrepositoryCloudformationStack(
  this,
  "postgres-rotator",
  {
    applicationId:
      "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser",
    capabilities: ["CAPABILITY_IAM", "CAPABILITY_RESOURCE_POLICY"],
    name: "postgres-rotator",
    parameters: {
      endpoint: `secretsmanager.\${${dataAwsRegionCurrent.name}}.\${${dataAwsPartitionCurrent.dnsSuffix}}`,
      functionName: "func-postgres-rotator",
    },
  }
);

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the stack to create. The resource deployed in AWS will be prefixed with serverlessrepo
  • applicationId - (Required) The ARN of the application from the Serverless Application Repository.
  • capabilities - (Required) A list of capabilities. Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, or CAPABILITY_AUTO_EXPAND
  • parameters - (Optional) A map of Parameter structures that specify input parameters for the stack.
  • semanticVersion - (Optional) The version of the application to deploy. If not supplied, deploys the latest version.
  • tags - (Optional) A list of tags to associate with this stack. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - A unique identifier of the stack.
  • outputs - A map of outputs from the stack.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags 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.,

$ terraform import aws_serverlessapplicationrepository_cloudformation_stack.example serverlessrepo-postgres-rotator