Skip to content

Resource: awsAppconfigExtension

Provides an AppConfig Extension resource.

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 awsSnsTopicTest = new aws.snsTopic.SnsTopic(this, "test", {
  name: "test",
});
const dataAwsIamPolicyDocumentTest =
  new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument(this, "test_1", {
    statement: [
      {
        actions: ["sts:AssumeRole"],
        principals: [
          {
            identifiers: ["appconfig.amazonaws.com"],
            type: "Service",
          },
        ],
      },
    ],
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAwsIamPolicyDocumentTest.overrideLogicalId("test");
const awsIamRoleTest = new aws.iamRole.IamRole(this, "test_2", {
  assumeRolePolicy: dataAwsIamPolicyDocumentTest.json,
  name: "test",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsIamRoleTest.overrideLogicalId("test");
const awsAppconfigExtensionTest = new aws.appconfigExtension.AppconfigExtension(
  this,
  "test_3",
  {
    actionPoint: [
      {
        action: [
          {
            name: "test",
            roleArn: awsIamRoleTest.arn,
            uri: awsSnsTopicTest.arn,
          },
        ],
        point: "ON_DEPLOYMENT_COMPLETE",
      },
    ],
    description: "test description",
    name: "test",
    tags: {
      Type: "AppConfig Extension",
    },
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsAppconfigExtensionTest.overrideLogicalId("test");

Argument Reference

The following arguments are supported:

  • name - (Required) A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.
  • description - (Optional) Information about the extension.
  • actionPoint - (Required) The action points defined in the extension. Detailed below.
  • parameter - (Optional) The parameters accepted by the extension. You specify parameter values when you associate the extension to an AppConfig resource by using the CreateExtensionAssociation API action. For Lambda extension actions, these parameters are included in the Lambda request object. Detailed below.
  • tags - (Optional) Map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

actionPoint

Defines the actions the extension performs during the AppConfig workflow and at which point those actions are performed. The actionPoint configuration block supports the following arguments:

  • point - (Required) The point at which to perform the defined actions. Valid points are PRE_CREATE_HOSTED_CONFIGURATION_VERSION, PRE_START_DEPLOYMENT, ON_DEPLOYMENT_START, ON_DEPLOYMENT_STEP, ON_DEPLOYMENT_BAKING, ON_DEPLOYMENT_COMPLETE, ON_DEPLOYMENT_ROLLED_BACK.
  • action - (Required) An action defines the tasks the extension performs during the AppConfig workflow. Detailed below.

action

The action configuration block supports configuring any number of the following arguments:

  • name - (Required) The action name.
  • roleArn - (Required) An Amazon Resource Name (ARN) for an Identity and Access Management assume role.
  • uri - (Required) The extension URI associated to the action point in the extension definition. The URI can be an Amazon Resource Name (ARN) for one of the following: an Lambda function, an Amazon Simple Queue Service queue, an Amazon Simple Notification Service topic, or the Amazon EventBridge default event bus.
  • description - (Optional) Information about the action.

parameter

The parameter configuration block supports configuring any number of the following arguments:

  • name - (Required) The parameter name.
  • required - (Required) Determines if a parameter value must be specified in the extension association.
  • description - (Optional) Information about the parameter.

Attributes Reference

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

  • arn - ARN of the AppConfig Extension.
  • id - AppConfig Extension ID.
  • version - The version number for the extension.

Import

AppConfig Extensions can be imported using their extension ID, e.g.,

$ terraform import aws_appconfig_extension.example 71rxuzt