Skip to content

Resource: awsCloudformationType

Manages a version of a CloudFormation Type.

\~> NOTE: The destroy operation of this resource marks the version as deprecated. If this was the only live version, the type is marked as deprecated. Enable the resource lifecycle configuration block createBeforeDestroy argument in this resource configuration to properly order redeployments in Terraform.

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 awsCloudformationTypeExample =
  new aws.cloudformationType.CloudformationType(this, "example", {
    loggingConfig: {
      logGroupName: "${aws_cloudwatch_log_group.example.name}",
      logRoleArn: "${aws_iam_role.example.arn}",
    },
    schemaHandlerPackage:
      "s3://${aws_s3_object.example.bucket}/${aws_s3_object.example.key}",
    type: "RESOURCE",
    typeName: "ExampleCompany::ExampleService::ExampleResource",
  });
awsCloudformationTypeExample.addOverride("lifecycle", [
  {
    create_before_destroy: true,
  },
]);

Argument Reference

The following arguments are supported:

  • executionRoleArn - (Optional) Amazon Resource Name (ARN) of the IAM Role for CloudFormation to assume when invoking the extension. If your extension calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the extension handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the extension handler, thereby supplying your extension with the appropriate credentials.
  • loggingConfig - (Optional) Configuration block containing logging configuration.
  • schemaHandlerPackage - (Required) URL to the S3 bucket containing the extension project package that contains the necessary files for the extension you want to register. Must begin with s3:// or https://. For example, s3://exampleBucket/exampleObject.
  • type - (Optional) CloudFormation Registry Type. For example, resource or module.
  • typeName - (Optional) CloudFormation Type name. For example, exampleCompany::exampleService::exampleResource.

loggingConfig

The following arguments are supported in the loggingConfig configuration block:

  • logGroupName - (Required) Name of the CloudWatch Log Group where CloudFormation sends error logging information when invoking the type's handlers.
  • logRoleArn - (Required) Amazon Resource Name (ARN) of the IAM Role CloudFormation assumes when sending error logging information to CloudWatch Logs.

Attributes Reference

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

  • arn - (Optional) Amazon Resource Name (ARN) of the CloudFormation Type version. See also typeArn.
  • defaultVersionId - Identifier of the CloudFormation Type default version.
  • deprecatedStatus - Deprecation status of the version.
  • description - Description of the version.
  • documentationUrl - URL of the documentation for the CloudFormation Type.
  • isDefaultVersion - Whether the CloudFormation Type version is the default version.
  • provisioningType - Provisioning behavior of the CloudFormation Type.
  • schema - JSON document of the CloudFormation Type schema.
  • sourceUrl - URL of the source code for the CloudFormation Type.
  • typeArn - (Optional) Amazon Resource Name (ARN) of the CloudFormation Type. See also arn.
  • versionId - (Optional) Identifier of the CloudFormation Type version.
  • visibility - Scope of the CloudFormation Type.

Import

awsCloudformationType can be imported with their type version Amazon Resource Name (ARN), e.g.,

terraform import aws_cloudformation_type.example arn:aws:cloudformation:us-east-1:123456789012:type/resource/ExampleCompany-ExampleService-ExampleType/1