Resource: aws_serverlessapplicationrepository_cloudformation_stack

Deploys an Application CloudFormation Stack from the Serverless Application Repository.

Example Usage

resource "aws_serverlessapplicationrepository_cloudformation_stack" "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     = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}"
  }
}

data "aws_partition" "current" {}
data "aws_region" "current" {}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import Serverless Application Repository Stack using the CloudFormation Stack name (with or without the serverlessrepo- prefix) or the CloudFormation Stack ID. For example:

import {
  to = aws_serverlessapplicationrepository_cloudformation_stack.example
  id = "serverlessrepo-postgres-rotator"
}

Using terraform import, import Serverless Application Repository Stack using the CloudFormation Stack name (with or without the serverlessrepo- prefix) or the CloudFormation Stack ID. For example:

% terraform import aws_serverlessapplicationrepository_cloudformation_stack.example serverlessrepo-postgres-rotator