aws logo
AWS Classic v5.29.1, Feb 4 23

aws.appconfig.ExtensionAssociation

Associates an AppConfig Extension with a Resource.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var testTopic = new Aws.Sns.Topic("testTopic");

    var testPolicyDocument = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Actions = new[]
                {
                    "sts:AssumeRole",
                },
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "Service",
                        Identifiers = new[]
                        {
                            "appconfig.amazonaws.com",
                        },
                    },
                },
            },
        },
    });

    var testRole = new Aws.Iam.Role("testRole", new()
    {
        AssumeRolePolicy = testPolicyDocument.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

    var testExtension = new Aws.AppConfig.Extension("testExtension", new()
    {
        Description = "test description",
        ActionPoints = new[]
        {
            new Aws.AppConfig.Inputs.ExtensionActionPointArgs
            {
                Point = "ON_DEPLOYMENT_COMPLETE",
                Actions = new[]
                {
                    new Aws.AppConfig.Inputs.ExtensionActionPointActionArgs
                    {
                        Name = "test",
                        RoleArn = testRole.Arn,
                        Uri = testTopic.Arn,
                    },
                },
            },
        },
        Tags = 
        {
            { "Type", "AppConfig Extension" },
        },
    });

    var testApplication = new Aws.AppConfig.Application("testApplication");

    var testExtensionAssociation = new Aws.AppConfig.ExtensionAssociation("testExtensionAssociation", new()
    {
        ExtensionArn = testExtension.Arn,
        ResourceArn = testApplication.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/appconfig"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/sns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testTopic, err := sns.NewTopic(ctx, "testTopic", nil)
		if err != nil {
			return err
		}
		testPolicyDocument, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Actions: []string{
						"sts:AssumeRole",
					},
					Principals: []iam.GetPolicyDocumentStatementPrincipal{
						{
							Type: "Service",
							Identifiers: []string{
								"appconfig.amazonaws.com",
							},
						},
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		testRole, err := iam.NewRole(ctx, "testRole", &iam.RoleArgs{
			AssumeRolePolicy: *pulumi.String(testPolicyDocument.Json),
		})
		if err != nil {
			return err
		}
		testExtension, err := appconfig.NewExtension(ctx, "testExtension", &appconfig.ExtensionArgs{
			Description: pulumi.String("test description"),
			ActionPoints: appconfig.ExtensionActionPointArray{
				&appconfig.ExtensionActionPointArgs{
					Point: pulumi.String("ON_DEPLOYMENT_COMPLETE"),
					Actions: appconfig.ExtensionActionPointActionArray{
						&appconfig.ExtensionActionPointActionArgs{
							Name:    pulumi.String("test"),
							RoleArn: testRole.Arn,
							Uri:     testTopic.Arn,
						},
					},
				},
			},
			Tags: pulumi.StringMap{
				"Type": pulumi.String("AppConfig Extension"),
			},
		})
		if err != nil {
			return err
		}
		testApplication, err := appconfig.NewApplication(ctx, "testApplication", nil)
		if err != nil {
			return err
		}
		_, err = appconfig.NewExtensionAssociation(ctx, "testExtensionAssociation", &appconfig.ExtensionAssociationArgs{
			ExtensionArn: testExtension.Arn,
			ResourceArn:  testApplication.Arn,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sns.Topic;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.appconfig.Extension;
import com.pulumi.aws.appconfig.ExtensionArgs;
import com.pulumi.aws.appconfig.inputs.ExtensionActionPointArgs;
import com.pulumi.aws.appconfig.Application;
import com.pulumi.aws.appconfig.ExtensionAssociation;
import com.pulumi.aws.appconfig.ExtensionAssociationArgs;
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) {
        var testTopic = new Topic("testTopic");

        final var testPolicyDocument = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .actions("sts:AssumeRole")
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("Service")
                    .identifiers("appconfig.amazonaws.com")
                    .build())
                .build())
            .build());

        var testRole = new Role("testRole", RoleArgs.builder()        
            .assumeRolePolicy(testPolicyDocument.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
            .build());

        var testExtension = new Extension("testExtension", ExtensionArgs.builder()        
            .description("test description")
            .actionPoints(ExtensionActionPointArgs.builder()
                .point("ON_DEPLOYMENT_COMPLETE")
                .actions(ExtensionActionPointActionArgs.builder()
                    .name("test")
                    .roleArn(testRole.arn())
                    .uri(testTopic.arn())
                    .build())
                .build())
            .tags(Map.of("Type", "AppConfig Extension"))
            .build());

        var testApplication = new Application("testApplication");

        var testExtensionAssociation = new ExtensionAssociation("testExtensionAssociation", ExtensionAssociationArgs.builder()        
            .extensionArn(testExtension.arn())
            .resourceArn(testApplication.arn())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

test_topic = aws.sns.Topic("testTopic")
test_policy_document = aws.iam.get_policy_document(statements=[aws.iam.GetPolicyDocumentStatementArgs(
    actions=["sts:AssumeRole"],
    principals=[aws.iam.GetPolicyDocumentStatementPrincipalArgs(
        type="Service",
        identifiers=["appconfig.amazonaws.com"],
    )],
)])
test_role = aws.iam.Role("testRole", assume_role_policy=test_policy_document.json)
test_extension = aws.appconfig.Extension("testExtension",
    description="test description",
    action_points=[aws.appconfig.ExtensionActionPointArgs(
        point="ON_DEPLOYMENT_COMPLETE",
        actions=[aws.appconfig.ExtensionActionPointActionArgs(
            name="test",
            role_arn=test_role.arn,
            uri=test_topic.arn,
        )],
    )],
    tags={
        "Type": "AppConfig Extension",
    })
test_application = aws.appconfig.Application("testApplication")
test_extension_association = aws.appconfig.ExtensionAssociation("testExtensionAssociation",
    extension_arn=test_extension.arn,
    resource_arn=test_application.arn)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testTopic = new aws.sns.Topic("testTopic", {});
const testPolicyDocument = aws.iam.getPolicyDocument({
    statements: [{
        actions: ["sts:AssumeRole"],
        principals: [{
            type: "Service",
            identifiers: ["appconfig.amazonaws.com"],
        }],
    }],
});
const testRole = new aws.iam.Role("testRole", {assumeRolePolicy: testPolicyDocument.then(testPolicyDocument => testPolicyDocument.json)});
const testExtension = new aws.appconfig.Extension("testExtension", {
    description: "test description",
    actionPoints: [{
        point: "ON_DEPLOYMENT_COMPLETE",
        actions: [{
            name: "test",
            roleArn: testRole.arn,
            uri: testTopic.arn,
        }],
    }],
    tags: {
        Type: "AppConfig Extension",
    },
});
const testApplication = new aws.appconfig.Application("testApplication", {});
const testExtensionAssociation = new aws.appconfig.ExtensionAssociation("testExtensionAssociation", {
    extensionArn: testExtension.arn,
    resourceArn: testApplication.arn,
});
resources:
  testTopic:
    type: aws:sns:Topic
  testRole:
    type: aws:iam:Role
    properties:
      assumeRolePolicy: ${testPolicyDocument.json}
  testExtension:
    type: aws:appconfig:Extension
    properties:
      description: test description
      actionPoints:
        - point: ON_DEPLOYMENT_COMPLETE
          actions:
            - name: test
              roleArn: ${testRole.arn}
              uri: ${testTopic.arn}
      tags:
        Type: AppConfig Extension
  testApplication:
    type: aws:appconfig:Application
  testExtensionAssociation:
    type: aws:appconfig:ExtensionAssociation
    properties:
      extensionArn: ${testExtension.arn}
      resourceArn: ${testApplication.arn}
variables:
  testPolicyDocument:
    fn::invoke:
      Function: aws:iam:getPolicyDocument
      Arguments:
        statements:
          - actions:
              - sts:AssumeRole
            principals:
              - type: Service
                identifiers:
                  - appconfig.amazonaws.com

Create ExtensionAssociation Resource

new ExtensionAssociation(name: string, args: ExtensionAssociationArgs, opts?: CustomResourceOptions);
@overload
def ExtensionAssociation(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         extension_arn: Optional[str] = None,
                         parameters: Optional[Mapping[str, str]] = None,
                         resource_arn: Optional[str] = None)
@overload
def ExtensionAssociation(resource_name: str,
                         args: ExtensionAssociationArgs,
                         opts: Optional[ResourceOptions] = None)
func NewExtensionAssociation(ctx *Context, name string, args ExtensionAssociationArgs, opts ...ResourceOption) (*ExtensionAssociation, error)
public ExtensionAssociation(string name, ExtensionAssociationArgs args, CustomResourceOptions? opts = null)
public ExtensionAssociation(String name, ExtensionAssociationArgs args)
public ExtensionAssociation(String name, ExtensionAssociationArgs args, CustomResourceOptions options)
type: aws:appconfig:ExtensionAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ExtensionAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ExtensionAssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ExtensionAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ExtensionAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ExtensionAssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ExtensionAssociation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ExtensionAssociation resource accepts the following input properties:

ExtensionArn string

The ARN of the extension defined in the association.

ResourceArn string

The ARN of the application, configuration profile, or environment to associate with the extension.

Parameters Dictionary<string, string>

The parameter names and values defined for the association.

ExtensionArn string

The ARN of the extension defined in the association.

ResourceArn string

The ARN of the application, configuration profile, or environment to associate with the extension.

Parameters map[string]string

The parameter names and values defined for the association.

extensionArn String

The ARN of the extension defined in the association.

resourceArn String

The ARN of the application, configuration profile, or environment to associate with the extension.

parameters Map<String,String>

The parameter names and values defined for the association.

extensionArn string

The ARN of the extension defined in the association.

resourceArn string

The ARN of the application, configuration profile, or environment to associate with the extension.

parameters {[key: string]: string}

The parameter names and values defined for the association.

extension_arn str

The ARN of the extension defined in the association.

resource_arn str

The ARN of the application, configuration profile, or environment to associate with the extension.

parameters Mapping[str, str]

The parameter names and values defined for the association.

extensionArn String

The ARN of the extension defined in the association.

resourceArn String

The ARN of the application, configuration profile, or environment to associate with the extension.

parameters Map<String>

The parameter names and values defined for the association.

Outputs

All input properties are implicitly available as output properties. Additionally, the ExtensionAssociation resource produces the following output properties:

Arn string

ARN of the AppConfig Extension Association.

ExtensionVersion int

The version number for the extension defined in the association.

Id string

The provider-assigned unique ID for this managed resource.

Arn string

ARN of the AppConfig Extension Association.

ExtensionVersion int

The version number for the extension defined in the association.

Id string

The provider-assigned unique ID for this managed resource.

arn String

ARN of the AppConfig Extension Association.

extensionVersion Integer

The version number for the extension defined in the association.

id String

The provider-assigned unique ID for this managed resource.

arn string

ARN of the AppConfig Extension Association.

extensionVersion number

The version number for the extension defined in the association.

id string

The provider-assigned unique ID for this managed resource.

arn str

ARN of the AppConfig Extension Association.

extension_version int

The version number for the extension defined in the association.

id str

The provider-assigned unique ID for this managed resource.

arn String

ARN of the AppConfig Extension Association.

extensionVersion Number

The version number for the extension defined in the association.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing ExtensionAssociation Resource

Get an existing ExtensionAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ExtensionAssociationState, opts?: CustomResourceOptions): ExtensionAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        extension_arn: Optional[str] = None,
        extension_version: Optional[int] = None,
        parameters: Optional[Mapping[str, str]] = None,
        resource_arn: Optional[str] = None) -> ExtensionAssociation
func GetExtensionAssociation(ctx *Context, name string, id IDInput, state *ExtensionAssociationState, opts ...ResourceOption) (*ExtensionAssociation, error)
public static ExtensionAssociation Get(string name, Input<string> id, ExtensionAssociationState? state, CustomResourceOptions? opts = null)
public static ExtensionAssociation get(String name, Output<String> id, ExtensionAssociationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

ARN of the AppConfig Extension Association.

ExtensionArn string

The ARN of the extension defined in the association.

ExtensionVersion int

The version number for the extension defined in the association.

Parameters Dictionary<string, string>

The parameter names and values defined for the association.

ResourceArn string

The ARN of the application, configuration profile, or environment to associate with the extension.

Arn string

ARN of the AppConfig Extension Association.

ExtensionArn string

The ARN of the extension defined in the association.

ExtensionVersion int

The version number for the extension defined in the association.

Parameters map[string]string

The parameter names and values defined for the association.

ResourceArn string

The ARN of the application, configuration profile, or environment to associate with the extension.

arn String

ARN of the AppConfig Extension Association.

extensionArn String

The ARN of the extension defined in the association.

extensionVersion Integer

The version number for the extension defined in the association.

parameters Map<String,String>

The parameter names and values defined for the association.

resourceArn String

The ARN of the application, configuration profile, or environment to associate with the extension.

arn string

ARN of the AppConfig Extension Association.

extensionArn string

The ARN of the extension defined in the association.

extensionVersion number

The version number for the extension defined in the association.

parameters {[key: string]: string}

The parameter names and values defined for the association.

resourceArn string

The ARN of the application, configuration profile, or environment to associate with the extension.

arn str

ARN of the AppConfig Extension Association.

extension_arn str

The ARN of the extension defined in the association.

extension_version int

The version number for the extension defined in the association.

parameters Mapping[str, str]

The parameter names and values defined for the association.

resource_arn str

The ARN of the application, configuration profile, or environment to associate with the extension.

arn String

ARN of the AppConfig Extension Association.

extensionArn String

The ARN of the extension defined in the association.

extensionVersion Number

The version number for the extension defined in the association.

parameters Map<String>

The parameter names and values defined for the association.

resourceArn String

The ARN of the application, configuration profile, or environment to associate with the extension.

Import

AppConfig Extension Associations can be imported using their extension association ID, e.g.,

 $ pulumi import aws:appconfig/extensionAssociation:ExtensionAssociation example 71rxuzt

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.