github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/servicecatalog/appregistryApplication.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 servicecatalog
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Resource for managing an AWS Service Catalog AppRegistry Application.
    15  //
    16  // > An AWS Service Catalog AppRegistry Application is displayed in the AWS Console under "MyApplications".
    17  //
    18  // ## Example Usage
    19  //
    20  // ### Basic Usage
    21  //
    22  // <!--Start PulumiCodeChooser -->
    23  // ```go
    24  // package main
    25  //
    26  // import (
    27  //
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicecatalog"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			_, err := servicecatalog.NewAppregistryApplication(ctx, "example", &servicecatalog.AppregistryApplicationArgs{
    36  //				Name: pulumi.String("example-app"),
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			return nil
    42  //		})
    43  //	}
    44  //
    45  // ```
    46  // <!--End PulumiCodeChooser -->
    47  //
    48  // ### Connecting Resources
    49  //
    50  // <!--Start PulumiCodeChooser -->
    51  // ```go
    52  // package main
    53  //
    54  // import (
    55  //
    56  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    57  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/servicecatalog"
    58  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    59  //
    60  // )
    61  //
    62  //	func main() {
    63  //		pulumi.Run(func(ctx *pulumi.Context) error {
    64  //			example, err := servicecatalog.NewAppregistryApplication(ctx, "example", &servicecatalog.AppregistryApplicationArgs{
    65  //				Name: pulumi.String("example-app"),
    66  //			})
    67  //			if err != nil {
    68  //				return err
    69  //			}
    70  //			_, err = s3.NewBucketV2(ctx, "bucket", &s3.BucketV2Args{
    71  //				Bucket: pulumi.String("example-bucket"),
    72  //				Tags:   example.ApplicationTag,
    73  //			})
    74  //			if err != nil {
    75  //				return err
    76  //			}
    77  //			return nil
    78  //		})
    79  //	}
    80  //
    81  // ```
    82  // <!--End PulumiCodeChooser -->
    83  //
    84  // ## Import
    85  //
    86  // Using `pulumi import`, import AWS Service Catalog AppRegistry Application using the `id`. For example:
    87  //
    88  // ```sh
    89  // $ pulumi import aws:servicecatalog/appregistryApplication:AppregistryApplication example application-id-12345678
    90  // ```
    91  type AppregistryApplication struct {
    92  	pulumi.CustomResourceState
    93  
    94  	// A map with a single tag key-value pair used to associate resources with the application. This attribute can be passed directly into the `tags` argument of another resource, or merged into a map of existing tags.
    95  	ApplicationTag pulumi.StringMapOutput `pulumi:"applicationTag"`
    96  	// ARN (Amazon Resource Name) of the application.
    97  	Arn pulumi.StringOutput `pulumi:"arn"`
    98  	// Description of the application.
    99  	Description pulumi.StringPtrOutput `pulumi:"description"`
   100  	// Name of the application. The name must be unique within an AWS region.
   101  	//
   102  	// The following arguments are optional:
   103  	Name pulumi.StringOutput `pulumi:"name"`
   104  }
   105  
   106  // NewAppregistryApplication registers a new resource with the given unique name, arguments, and options.
   107  func NewAppregistryApplication(ctx *pulumi.Context,
   108  	name string, args *AppregistryApplicationArgs, opts ...pulumi.ResourceOption) (*AppregistryApplication, error) {
   109  	if args == nil {
   110  		args = &AppregistryApplicationArgs{}
   111  	}
   112  
   113  	opts = internal.PkgResourceDefaultOpts(opts)
   114  	var resource AppregistryApplication
   115  	err := ctx.RegisterResource("aws:servicecatalog/appregistryApplication:AppregistryApplication", name, args, &resource, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return &resource, nil
   120  }
   121  
   122  // GetAppregistryApplication gets an existing AppregistryApplication resource's state with the given name, ID, and optional
   123  // state properties that are used to uniquely qualify the lookup (nil if not required).
   124  func GetAppregistryApplication(ctx *pulumi.Context,
   125  	name string, id pulumi.IDInput, state *AppregistryApplicationState, opts ...pulumi.ResourceOption) (*AppregistryApplication, error) {
   126  	var resource AppregistryApplication
   127  	err := ctx.ReadResource("aws:servicecatalog/appregistryApplication:AppregistryApplication", name, id, state, &resource, opts...)
   128  	if err != nil {
   129  		return nil, err
   130  	}
   131  	return &resource, nil
   132  }
   133  
   134  // Input properties used for looking up and filtering AppregistryApplication resources.
   135  type appregistryApplicationState struct {
   136  	// A map with a single tag key-value pair used to associate resources with the application. This attribute can be passed directly into the `tags` argument of another resource, or merged into a map of existing tags.
   137  	ApplicationTag map[string]string `pulumi:"applicationTag"`
   138  	// ARN (Amazon Resource Name) of the application.
   139  	Arn *string `pulumi:"arn"`
   140  	// Description of the application.
   141  	Description *string `pulumi:"description"`
   142  	// Name of the application. The name must be unique within an AWS region.
   143  	//
   144  	// The following arguments are optional:
   145  	Name *string `pulumi:"name"`
   146  }
   147  
   148  type AppregistryApplicationState struct {
   149  	// A map with a single tag key-value pair used to associate resources with the application. This attribute can be passed directly into the `tags` argument of another resource, or merged into a map of existing tags.
   150  	ApplicationTag pulumi.StringMapInput
   151  	// ARN (Amazon Resource Name) of the application.
   152  	Arn pulumi.StringPtrInput
   153  	// Description of the application.
   154  	Description pulumi.StringPtrInput
   155  	// Name of the application. The name must be unique within an AWS region.
   156  	//
   157  	// The following arguments are optional:
   158  	Name pulumi.StringPtrInput
   159  }
   160  
   161  func (AppregistryApplicationState) ElementType() reflect.Type {
   162  	return reflect.TypeOf((*appregistryApplicationState)(nil)).Elem()
   163  }
   164  
   165  type appregistryApplicationArgs struct {
   166  	// Description of the application.
   167  	Description *string `pulumi:"description"`
   168  	// Name of the application. The name must be unique within an AWS region.
   169  	//
   170  	// The following arguments are optional:
   171  	Name *string `pulumi:"name"`
   172  }
   173  
   174  // The set of arguments for constructing a AppregistryApplication resource.
   175  type AppregistryApplicationArgs struct {
   176  	// Description of the application.
   177  	Description pulumi.StringPtrInput
   178  	// Name of the application. The name must be unique within an AWS region.
   179  	//
   180  	// The following arguments are optional:
   181  	Name pulumi.StringPtrInput
   182  }
   183  
   184  func (AppregistryApplicationArgs) ElementType() reflect.Type {
   185  	return reflect.TypeOf((*appregistryApplicationArgs)(nil)).Elem()
   186  }
   187  
   188  type AppregistryApplicationInput interface {
   189  	pulumi.Input
   190  
   191  	ToAppregistryApplicationOutput() AppregistryApplicationOutput
   192  	ToAppregistryApplicationOutputWithContext(ctx context.Context) AppregistryApplicationOutput
   193  }
   194  
   195  func (*AppregistryApplication) ElementType() reflect.Type {
   196  	return reflect.TypeOf((**AppregistryApplication)(nil)).Elem()
   197  }
   198  
   199  func (i *AppregistryApplication) ToAppregistryApplicationOutput() AppregistryApplicationOutput {
   200  	return i.ToAppregistryApplicationOutputWithContext(context.Background())
   201  }
   202  
   203  func (i *AppregistryApplication) ToAppregistryApplicationOutputWithContext(ctx context.Context) AppregistryApplicationOutput {
   204  	return pulumi.ToOutputWithContext(ctx, i).(AppregistryApplicationOutput)
   205  }
   206  
   207  // AppregistryApplicationArrayInput is an input type that accepts AppregistryApplicationArray and AppregistryApplicationArrayOutput values.
   208  // You can construct a concrete instance of `AppregistryApplicationArrayInput` via:
   209  //
   210  //	AppregistryApplicationArray{ AppregistryApplicationArgs{...} }
   211  type AppregistryApplicationArrayInput interface {
   212  	pulumi.Input
   213  
   214  	ToAppregistryApplicationArrayOutput() AppregistryApplicationArrayOutput
   215  	ToAppregistryApplicationArrayOutputWithContext(context.Context) AppregistryApplicationArrayOutput
   216  }
   217  
   218  type AppregistryApplicationArray []AppregistryApplicationInput
   219  
   220  func (AppregistryApplicationArray) ElementType() reflect.Type {
   221  	return reflect.TypeOf((*[]*AppregistryApplication)(nil)).Elem()
   222  }
   223  
   224  func (i AppregistryApplicationArray) ToAppregistryApplicationArrayOutput() AppregistryApplicationArrayOutput {
   225  	return i.ToAppregistryApplicationArrayOutputWithContext(context.Background())
   226  }
   227  
   228  func (i AppregistryApplicationArray) ToAppregistryApplicationArrayOutputWithContext(ctx context.Context) AppregistryApplicationArrayOutput {
   229  	return pulumi.ToOutputWithContext(ctx, i).(AppregistryApplicationArrayOutput)
   230  }
   231  
   232  // AppregistryApplicationMapInput is an input type that accepts AppregistryApplicationMap and AppregistryApplicationMapOutput values.
   233  // You can construct a concrete instance of `AppregistryApplicationMapInput` via:
   234  //
   235  //	AppregistryApplicationMap{ "key": AppregistryApplicationArgs{...} }
   236  type AppregistryApplicationMapInput interface {
   237  	pulumi.Input
   238  
   239  	ToAppregistryApplicationMapOutput() AppregistryApplicationMapOutput
   240  	ToAppregistryApplicationMapOutputWithContext(context.Context) AppregistryApplicationMapOutput
   241  }
   242  
   243  type AppregistryApplicationMap map[string]AppregistryApplicationInput
   244  
   245  func (AppregistryApplicationMap) ElementType() reflect.Type {
   246  	return reflect.TypeOf((*map[string]*AppregistryApplication)(nil)).Elem()
   247  }
   248  
   249  func (i AppregistryApplicationMap) ToAppregistryApplicationMapOutput() AppregistryApplicationMapOutput {
   250  	return i.ToAppregistryApplicationMapOutputWithContext(context.Background())
   251  }
   252  
   253  func (i AppregistryApplicationMap) ToAppregistryApplicationMapOutputWithContext(ctx context.Context) AppregistryApplicationMapOutput {
   254  	return pulumi.ToOutputWithContext(ctx, i).(AppregistryApplicationMapOutput)
   255  }
   256  
   257  type AppregistryApplicationOutput struct{ *pulumi.OutputState }
   258  
   259  func (AppregistryApplicationOutput) ElementType() reflect.Type {
   260  	return reflect.TypeOf((**AppregistryApplication)(nil)).Elem()
   261  }
   262  
   263  func (o AppregistryApplicationOutput) ToAppregistryApplicationOutput() AppregistryApplicationOutput {
   264  	return o
   265  }
   266  
   267  func (o AppregistryApplicationOutput) ToAppregistryApplicationOutputWithContext(ctx context.Context) AppregistryApplicationOutput {
   268  	return o
   269  }
   270  
   271  // A map with a single tag key-value pair used to associate resources with the application. This attribute can be passed directly into the `tags` argument of another resource, or merged into a map of existing tags.
   272  func (o AppregistryApplicationOutput) ApplicationTag() pulumi.StringMapOutput {
   273  	return o.ApplyT(func(v *AppregistryApplication) pulumi.StringMapOutput { return v.ApplicationTag }).(pulumi.StringMapOutput)
   274  }
   275  
   276  // ARN (Amazon Resource Name) of the application.
   277  func (o AppregistryApplicationOutput) Arn() pulumi.StringOutput {
   278  	return o.ApplyT(func(v *AppregistryApplication) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   279  }
   280  
   281  // Description of the application.
   282  func (o AppregistryApplicationOutput) Description() pulumi.StringPtrOutput {
   283  	return o.ApplyT(func(v *AppregistryApplication) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   284  }
   285  
   286  // Name of the application. The name must be unique within an AWS region.
   287  //
   288  // The following arguments are optional:
   289  func (o AppregistryApplicationOutput) Name() pulumi.StringOutput {
   290  	return o.ApplyT(func(v *AppregistryApplication) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   291  }
   292  
   293  type AppregistryApplicationArrayOutput struct{ *pulumi.OutputState }
   294  
   295  func (AppregistryApplicationArrayOutput) ElementType() reflect.Type {
   296  	return reflect.TypeOf((*[]*AppregistryApplication)(nil)).Elem()
   297  }
   298  
   299  func (o AppregistryApplicationArrayOutput) ToAppregistryApplicationArrayOutput() AppregistryApplicationArrayOutput {
   300  	return o
   301  }
   302  
   303  func (o AppregistryApplicationArrayOutput) ToAppregistryApplicationArrayOutputWithContext(ctx context.Context) AppregistryApplicationArrayOutput {
   304  	return o
   305  }
   306  
   307  func (o AppregistryApplicationArrayOutput) Index(i pulumi.IntInput) AppregistryApplicationOutput {
   308  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppregistryApplication {
   309  		return vs[0].([]*AppregistryApplication)[vs[1].(int)]
   310  	}).(AppregistryApplicationOutput)
   311  }
   312  
   313  type AppregistryApplicationMapOutput struct{ *pulumi.OutputState }
   314  
   315  func (AppregistryApplicationMapOutput) ElementType() reflect.Type {
   316  	return reflect.TypeOf((*map[string]*AppregistryApplication)(nil)).Elem()
   317  }
   318  
   319  func (o AppregistryApplicationMapOutput) ToAppregistryApplicationMapOutput() AppregistryApplicationMapOutput {
   320  	return o
   321  }
   322  
   323  func (o AppregistryApplicationMapOutput) ToAppregistryApplicationMapOutputWithContext(ctx context.Context) AppregistryApplicationMapOutput {
   324  	return o
   325  }
   326  
   327  func (o AppregistryApplicationMapOutput) MapIndex(k pulumi.StringInput) AppregistryApplicationOutput {
   328  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppregistryApplication {
   329  		return vs[0].(map[string]*AppregistryApplication)[vs[1].(string)]
   330  	}).(AppregistryApplicationOutput)
   331  }
   332  
   333  func init() {
   334  	pulumi.RegisterInputType(reflect.TypeOf((*AppregistryApplicationInput)(nil)).Elem(), &AppregistryApplication{})
   335  	pulumi.RegisterInputType(reflect.TypeOf((*AppregistryApplicationArrayInput)(nil)).Elem(), AppregistryApplicationArray{})
   336  	pulumi.RegisterInputType(reflect.TypeOf((*AppregistryApplicationMapInput)(nil)).Elem(), AppregistryApplicationMap{})
   337  	pulumi.RegisterOutputType(AppregistryApplicationOutput{})
   338  	pulumi.RegisterOutputType(AppregistryApplicationArrayOutput{})
   339  	pulumi.RegisterOutputType(AppregistryApplicationMapOutput{})
   340  }