github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appconfig/extension.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package appconfig
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides an AppConfig Extension resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appconfig"
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sns"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			testTopic, err := sns.NewTopic(ctx, "test", &sns.TopicArgs{
    35  //				Name: pulumi.String("test"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			test, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    41  //				Statements: []iam.GetPolicyDocumentStatement{
    42  //					{
    43  //						Actions: []string{
    44  //							"sts:AssumeRole",
    45  //						},
    46  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    47  //							{
    48  //								Type: "Service",
    49  //								Identifiers: []string{
    50  //									"appconfig.amazonaws.com",
    51  //								},
    52  //							},
    53  //						},
    54  //					},
    55  //				},
    56  //			}, nil)
    57  //			if err != nil {
    58  //				return err
    59  //			}
    60  //			testRole, err := iam.NewRole(ctx, "test", &iam.RoleArgs{
    61  //				Name:             pulumi.String("test"),
    62  //				AssumeRolePolicy: pulumi.String(test.Json),
    63  //			})
    64  //			if err != nil {
    65  //				return err
    66  //			}
    67  //			_, err = appconfig.NewExtension(ctx, "test", &appconfig.ExtensionArgs{
    68  //				Name:        pulumi.String("test"),
    69  //				Description: pulumi.String("test description"),
    70  //				ActionPoints: appconfig.ExtensionActionPointArray{
    71  //					&appconfig.ExtensionActionPointArgs{
    72  //						Point: pulumi.String("ON_DEPLOYMENT_COMPLETE"),
    73  //						Actions: appconfig.ExtensionActionPointActionArray{
    74  //							&appconfig.ExtensionActionPointActionArgs{
    75  //								Name:    pulumi.String("test"),
    76  //								RoleArn: testRole.Arn,
    77  //								Uri:     testTopic.Arn,
    78  //							},
    79  //						},
    80  //					},
    81  //				},
    82  //				Tags: pulumi.StringMap{
    83  //					"Type": pulumi.String("AppConfig Extension"),
    84  //				},
    85  //			})
    86  //			if err != nil {
    87  //				return err
    88  //			}
    89  //			return nil
    90  //		})
    91  //	}
    92  //
    93  // ```
    94  // <!--End PulumiCodeChooser -->
    95  //
    96  // ## Import
    97  //
    98  // Using `pulumi import`, import AppConfig Extensions using their extension ID. For example:
    99  //
   100  // ```sh
   101  // $ pulumi import aws:appconfig/extension:Extension example 71rxuzt
   102  // ```
   103  type Extension struct {
   104  	pulumi.CustomResourceState
   105  
   106  	// The action points defined in the extension. Detailed below.
   107  	ActionPoints ExtensionActionPointArrayOutput `pulumi:"actionPoints"`
   108  	// ARN of the AppConfig Extension.
   109  	Arn pulumi.StringOutput `pulumi:"arn"`
   110  	// Information about the extension.
   111  	Description pulumi.StringOutput `pulumi:"description"`
   112  	// A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.
   113  	Name pulumi.StringOutput `pulumi:"name"`
   114  	// 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.
   115  	Parameters ExtensionParameterArrayOutput `pulumi:"parameters"`
   116  	// 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.
   117  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   118  	// Deprecated: Please use `tags` instead.
   119  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   120  	// The version number for the extension.
   121  	Version pulumi.IntOutput `pulumi:"version"`
   122  }
   123  
   124  // NewExtension registers a new resource with the given unique name, arguments, and options.
   125  func NewExtension(ctx *pulumi.Context,
   126  	name string, args *ExtensionArgs, opts ...pulumi.ResourceOption) (*Extension, error) {
   127  	if args == nil {
   128  		return nil, errors.New("missing one or more required arguments")
   129  	}
   130  
   131  	if args.ActionPoints == nil {
   132  		return nil, errors.New("invalid value for required argument 'ActionPoints'")
   133  	}
   134  	opts = internal.PkgResourceDefaultOpts(opts)
   135  	var resource Extension
   136  	err := ctx.RegisterResource("aws:appconfig/extension:Extension", name, args, &resource, opts...)
   137  	if err != nil {
   138  		return nil, err
   139  	}
   140  	return &resource, nil
   141  }
   142  
   143  // GetExtension gets an existing Extension resource's state with the given name, ID, and optional
   144  // state properties that are used to uniquely qualify the lookup (nil if not required).
   145  func GetExtension(ctx *pulumi.Context,
   146  	name string, id pulumi.IDInput, state *ExtensionState, opts ...pulumi.ResourceOption) (*Extension, error) {
   147  	var resource Extension
   148  	err := ctx.ReadResource("aws:appconfig/extension:Extension", name, id, state, &resource, opts...)
   149  	if err != nil {
   150  		return nil, err
   151  	}
   152  	return &resource, nil
   153  }
   154  
   155  // Input properties used for looking up and filtering Extension resources.
   156  type extensionState struct {
   157  	// The action points defined in the extension. Detailed below.
   158  	ActionPoints []ExtensionActionPoint `pulumi:"actionPoints"`
   159  	// ARN of the AppConfig Extension.
   160  	Arn *string `pulumi:"arn"`
   161  	// Information about the extension.
   162  	Description *string `pulumi:"description"`
   163  	// A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.
   164  	Name *string `pulumi:"name"`
   165  	// 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.
   166  	Parameters []ExtensionParameter `pulumi:"parameters"`
   167  	// 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.
   168  	Tags map[string]string `pulumi:"tags"`
   169  	// Deprecated: Please use `tags` instead.
   170  	TagsAll map[string]string `pulumi:"tagsAll"`
   171  	// The version number for the extension.
   172  	Version *int `pulumi:"version"`
   173  }
   174  
   175  type ExtensionState struct {
   176  	// The action points defined in the extension. Detailed below.
   177  	ActionPoints ExtensionActionPointArrayInput
   178  	// ARN of the AppConfig Extension.
   179  	Arn pulumi.StringPtrInput
   180  	// Information about the extension.
   181  	Description pulumi.StringPtrInput
   182  	// A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.
   183  	Name pulumi.StringPtrInput
   184  	// 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.
   185  	Parameters ExtensionParameterArrayInput
   186  	// 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.
   187  	Tags pulumi.StringMapInput
   188  	// Deprecated: Please use `tags` instead.
   189  	TagsAll pulumi.StringMapInput
   190  	// The version number for the extension.
   191  	Version pulumi.IntPtrInput
   192  }
   193  
   194  func (ExtensionState) ElementType() reflect.Type {
   195  	return reflect.TypeOf((*extensionState)(nil)).Elem()
   196  }
   197  
   198  type extensionArgs struct {
   199  	// The action points defined in the extension. Detailed below.
   200  	ActionPoints []ExtensionActionPoint `pulumi:"actionPoints"`
   201  	// Information about the extension.
   202  	Description *string `pulumi:"description"`
   203  	// A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.
   204  	Name *string `pulumi:"name"`
   205  	// 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.
   206  	Parameters []ExtensionParameter `pulumi:"parameters"`
   207  	// 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.
   208  	Tags map[string]string `pulumi:"tags"`
   209  }
   210  
   211  // The set of arguments for constructing a Extension resource.
   212  type ExtensionArgs struct {
   213  	// The action points defined in the extension. Detailed below.
   214  	ActionPoints ExtensionActionPointArrayInput
   215  	// Information about the extension.
   216  	Description pulumi.StringPtrInput
   217  	// A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.
   218  	Name pulumi.StringPtrInput
   219  	// 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.
   220  	Parameters ExtensionParameterArrayInput
   221  	// 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.
   222  	Tags pulumi.StringMapInput
   223  }
   224  
   225  func (ExtensionArgs) ElementType() reflect.Type {
   226  	return reflect.TypeOf((*extensionArgs)(nil)).Elem()
   227  }
   228  
   229  type ExtensionInput interface {
   230  	pulumi.Input
   231  
   232  	ToExtensionOutput() ExtensionOutput
   233  	ToExtensionOutputWithContext(ctx context.Context) ExtensionOutput
   234  }
   235  
   236  func (*Extension) ElementType() reflect.Type {
   237  	return reflect.TypeOf((**Extension)(nil)).Elem()
   238  }
   239  
   240  func (i *Extension) ToExtensionOutput() ExtensionOutput {
   241  	return i.ToExtensionOutputWithContext(context.Background())
   242  }
   243  
   244  func (i *Extension) ToExtensionOutputWithContext(ctx context.Context) ExtensionOutput {
   245  	return pulumi.ToOutputWithContext(ctx, i).(ExtensionOutput)
   246  }
   247  
   248  // ExtensionArrayInput is an input type that accepts ExtensionArray and ExtensionArrayOutput values.
   249  // You can construct a concrete instance of `ExtensionArrayInput` via:
   250  //
   251  //	ExtensionArray{ ExtensionArgs{...} }
   252  type ExtensionArrayInput interface {
   253  	pulumi.Input
   254  
   255  	ToExtensionArrayOutput() ExtensionArrayOutput
   256  	ToExtensionArrayOutputWithContext(context.Context) ExtensionArrayOutput
   257  }
   258  
   259  type ExtensionArray []ExtensionInput
   260  
   261  func (ExtensionArray) ElementType() reflect.Type {
   262  	return reflect.TypeOf((*[]*Extension)(nil)).Elem()
   263  }
   264  
   265  func (i ExtensionArray) ToExtensionArrayOutput() ExtensionArrayOutput {
   266  	return i.ToExtensionArrayOutputWithContext(context.Background())
   267  }
   268  
   269  func (i ExtensionArray) ToExtensionArrayOutputWithContext(ctx context.Context) ExtensionArrayOutput {
   270  	return pulumi.ToOutputWithContext(ctx, i).(ExtensionArrayOutput)
   271  }
   272  
   273  // ExtensionMapInput is an input type that accepts ExtensionMap and ExtensionMapOutput values.
   274  // You can construct a concrete instance of `ExtensionMapInput` via:
   275  //
   276  //	ExtensionMap{ "key": ExtensionArgs{...} }
   277  type ExtensionMapInput interface {
   278  	pulumi.Input
   279  
   280  	ToExtensionMapOutput() ExtensionMapOutput
   281  	ToExtensionMapOutputWithContext(context.Context) ExtensionMapOutput
   282  }
   283  
   284  type ExtensionMap map[string]ExtensionInput
   285  
   286  func (ExtensionMap) ElementType() reflect.Type {
   287  	return reflect.TypeOf((*map[string]*Extension)(nil)).Elem()
   288  }
   289  
   290  func (i ExtensionMap) ToExtensionMapOutput() ExtensionMapOutput {
   291  	return i.ToExtensionMapOutputWithContext(context.Background())
   292  }
   293  
   294  func (i ExtensionMap) ToExtensionMapOutputWithContext(ctx context.Context) ExtensionMapOutput {
   295  	return pulumi.ToOutputWithContext(ctx, i).(ExtensionMapOutput)
   296  }
   297  
   298  type ExtensionOutput struct{ *pulumi.OutputState }
   299  
   300  func (ExtensionOutput) ElementType() reflect.Type {
   301  	return reflect.TypeOf((**Extension)(nil)).Elem()
   302  }
   303  
   304  func (o ExtensionOutput) ToExtensionOutput() ExtensionOutput {
   305  	return o
   306  }
   307  
   308  func (o ExtensionOutput) ToExtensionOutputWithContext(ctx context.Context) ExtensionOutput {
   309  	return o
   310  }
   311  
   312  // The action points defined in the extension. Detailed below.
   313  func (o ExtensionOutput) ActionPoints() ExtensionActionPointArrayOutput {
   314  	return o.ApplyT(func(v *Extension) ExtensionActionPointArrayOutput { return v.ActionPoints }).(ExtensionActionPointArrayOutput)
   315  }
   316  
   317  // ARN of the AppConfig Extension.
   318  func (o ExtensionOutput) Arn() pulumi.StringOutput {
   319  	return o.ApplyT(func(v *Extension) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   320  }
   321  
   322  // Information about the extension.
   323  func (o ExtensionOutput) Description() pulumi.StringOutput {
   324  	return o.ApplyT(func(v *Extension) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
   325  }
   326  
   327  // A name for the extension. Each extension name in your account must be unique. Extension versions use the same name.
   328  func (o ExtensionOutput) Name() pulumi.StringOutput {
   329  	return o.ApplyT(func(v *Extension) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   330  }
   331  
   332  // 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.
   333  func (o ExtensionOutput) Parameters() ExtensionParameterArrayOutput {
   334  	return o.ApplyT(func(v *Extension) ExtensionParameterArrayOutput { return v.Parameters }).(ExtensionParameterArrayOutput)
   335  }
   336  
   337  // 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.
   338  func (o ExtensionOutput) Tags() pulumi.StringMapOutput {
   339  	return o.ApplyT(func(v *Extension) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   340  }
   341  
   342  // Deprecated: Please use `tags` instead.
   343  func (o ExtensionOutput) TagsAll() pulumi.StringMapOutput {
   344  	return o.ApplyT(func(v *Extension) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   345  }
   346  
   347  // The version number for the extension.
   348  func (o ExtensionOutput) Version() pulumi.IntOutput {
   349  	return o.ApplyT(func(v *Extension) pulumi.IntOutput { return v.Version }).(pulumi.IntOutput)
   350  }
   351  
   352  type ExtensionArrayOutput struct{ *pulumi.OutputState }
   353  
   354  func (ExtensionArrayOutput) ElementType() reflect.Type {
   355  	return reflect.TypeOf((*[]*Extension)(nil)).Elem()
   356  }
   357  
   358  func (o ExtensionArrayOutput) ToExtensionArrayOutput() ExtensionArrayOutput {
   359  	return o
   360  }
   361  
   362  func (o ExtensionArrayOutput) ToExtensionArrayOutputWithContext(ctx context.Context) ExtensionArrayOutput {
   363  	return o
   364  }
   365  
   366  func (o ExtensionArrayOutput) Index(i pulumi.IntInput) ExtensionOutput {
   367  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Extension {
   368  		return vs[0].([]*Extension)[vs[1].(int)]
   369  	}).(ExtensionOutput)
   370  }
   371  
   372  type ExtensionMapOutput struct{ *pulumi.OutputState }
   373  
   374  func (ExtensionMapOutput) ElementType() reflect.Type {
   375  	return reflect.TypeOf((*map[string]*Extension)(nil)).Elem()
   376  }
   377  
   378  func (o ExtensionMapOutput) ToExtensionMapOutput() ExtensionMapOutput {
   379  	return o
   380  }
   381  
   382  func (o ExtensionMapOutput) ToExtensionMapOutputWithContext(ctx context.Context) ExtensionMapOutput {
   383  	return o
   384  }
   385  
   386  func (o ExtensionMapOutput) MapIndex(k pulumi.StringInput) ExtensionOutput {
   387  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Extension {
   388  		return vs[0].(map[string]*Extension)[vs[1].(string)]
   389  	}).(ExtensionOutput)
   390  }
   391  
   392  func init() {
   393  	pulumi.RegisterInputType(reflect.TypeOf((*ExtensionInput)(nil)).Elem(), &Extension{})
   394  	pulumi.RegisterInputType(reflect.TypeOf((*ExtensionArrayInput)(nil)).Elem(), ExtensionArray{})
   395  	pulumi.RegisterInputType(reflect.TypeOf((*ExtensionMapInput)(nil)).Elem(), ExtensionMap{})
   396  	pulumi.RegisterOutputType(ExtensionOutput{})
   397  	pulumi.RegisterOutputType(ExtensionArrayOutput{})
   398  	pulumi.RegisterOutputType(ExtensionMapOutput{})
   399  }