github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/elasticbeanstalk/applicationVersion.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 elasticbeanstalk 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 Elastic Beanstalk Application Version Resource. Elastic Beanstalk allows 16 // you to deploy and manage applications in the AWS cloud without worrying about 17 // the infrastructure that runs those applications. 18 // 19 // This resource creates a Beanstalk Application Version that can be deployed to a Beanstalk 20 // Environment. 21 // 22 // > **NOTE on Application Version Resource:** When using the Application Version resource with multiple 23 // Elastic Beanstalk Environments it is possible that an error may be returned 24 // when attempting to delete an Application Version while it is still in use by a different environment. 25 // To work around this you can either create each environment in a separate AWS account or create your `elasticbeanstalk.ApplicationVersion` resources with a unique names in your Elastic Beanstalk Application. For example <revision>-<environment>. 26 // 27 // ## Example Usage 28 // 29 // <!--Start PulumiCodeChooser --> 30 // ```go 31 // package main 32 // 33 // import ( 34 // 35 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticbeanstalk" 36 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3" 37 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 38 // 39 // ) 40 // 41 // func main() { 42 // pulumi.Run(func(ctx *pulumi.Context) error { 43 // _, err := s3.NewBucketV2(ctx, "default", &s3.BucketV2Args{ 44 // Bucket: pulumi.String("tftest.applicationversion.bucket"), 45 // }) 46 // if err != nil { 47 // return err 48 // } 49 // defaultBucketObjectv2, err := s3.NewBucketObjectv2(ctx, "default", &s3.BucketObjectv2Args{ 50 // Bucket: _default.ID(), 51 // Key: pulumi.String("beanstalk/go-v1.zip"), 52 // Source: pulumi.NewFileAsset("go-v1.zip"), 53 // }) 54 // if err != nil { 55 // return err 56 // } 57 // _, err = elasticbeanstalk.NewApplication(ctx, "default", &elasticbeanstalk.ApplicationArgs{ 58 // Name: pulumi.String("tf-test-name"), 59 // Description: pulumi.String("tf-test-desc"), 60 // }) 61 // if err != nil { 62 // return err 63 // } 64 // _, err = elasticbeanstalk.NewApplicationVersion(ctx, "default", &elasticbeanstalk.ApplicationVersionArgs{ 65 // Name: pulumi.String("tf-test-version-label"), 66 // Application: pulumi.Any("tf-test-name"), 67 // Description: pulumi.String("application version"), 68 // Bucket: _default.ID(), 69 // Key: defaultBucketObjectv2.ID(), 70 // }) 71 // if err != nil { 72 // return err 73 // } 74 // return nil 75 // }) 76 // } 77 // 78 // ``` 79 // <!--End PulumiCodeChooser --> 80 type ApplicationVersion struct { 81 pulumi.CustomResourceState 82 83 // Name of the Beanstalk Application the version is associated with. 84 Application pulumi.StringOutput `pulumi:"application"` 85 // ARN assigned by AWS for this Elastic Beanstalk Application. 86 Arn pulumi.StringOutput `pulumi:"arn"` 87 // S3 bucket that contains the Application Version source bundle. 88 Bucket pulumi.StringOutput `pulumi:"bucket"` 89 // Short description of the Application Version. 90 Description pulumi.StringPtrOutput `pulumi:"description"` 91 // On delete, force an Application Version to be deleted when it may be in use by multiple Elastic Beanstalk Environments. 92 ForceDelete pulumi.BoolPtrOutput `pulumi:"forceDelete"` 93 // S3 object that is the Application Version source bundle. 94 Key pulumi.StringOutput `pulumi:"key"` 95 // Unique name for the this Application Version. 96 // 97 // The following arguments are optional: 98 Name pulumi.StringOutput `pulumi:"name"` 99 // Key-value map of tags for the Elastic Beanstalk Application Version. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 100 Tags pulumi.StringMapOutput `pulumi:"tags"` 101 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 102 // 103 // Deprecated: Please use `tags` instead. 104 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 105 } 106 107 // NewApplicationVersion registers a new resource with the given unique name, arguments, and options. 108 func NewApplicationVersion(ctx *pulumi.Context, 109 name string, args *ApplicationVersionArgs, opts ...pulumi.ResourceOption) (*ApplicationVersion, error) { 110 if args == nil { 111 return nil, errors.New("missing one or more required arguments") 112 } 113 114 if args.Application == nil { 115 return nil, errors.New("invalid value for required argument 'Application'") 116 } 117 if args.Bucket == nil { 118 return nil, errors.New("invalid value for required argument 'Bucket'") 119 } 120 if args.Key == nil { 121 return nil, errors.New("invalid value for required argument 'Key'") 122 } 123 opts = internal.PkgResourceDefaultOpts(opts) 124 var resource ApplicationVersion 125 err := ctx.RegisterResource("aws:elasticbeanstalk/applicationVersion:ApplicationVersion", name, args, &resource, opts...) 126 if err != nil { 127 return nil, err 128 } 129 return &resource, nil 130 } 131 132 // GetApplicationVersion gets an existing ApplicationVersion resource's state with the given name, ID, and optional 133 // state properties that are used to uniquely qualify the lookup (nil if not required). 134 func GetApplicationVersion(ctx *pulumi.Context, 135 name string, id pulumi.IDInput, state *ApplicationVersionState, opts ...pulumi.ResourceOption) (*ApplicationVersion, error) { 136 var resource ApplicationVersion 137 err := ctx.ReadResource("aws:elasticbeanstalk/applicationVersion:ApplicationVersion", name, id, state, &resource, opts...) 138 if err != nil { 139 return nil, err 140 } 141 return &resource, nil 142 } 143 144 // Input properties used for looking up and filtering ApplicationVersion resources. 145 type applicationVersionState struct { 146 // Name of the Beanstalk Application the version is associated with. 147 Application interface{} `pulumi:"application"` 148 // ARN assigned by AWS for this Elastic Beanstalk Application. 149 Arn *string `pulumi:"arn"` 150 // S3 bucket that contains the Application Version source bundle. 151 Bucket interface{} `pulumi:"bucket"` 152 // Short description of the Application Version. 153 Description *string `pulumi:"description"` 154 // On delete, force an Application Version to be deleted when it may be in use by multiple Elastic Beanstalk Environments. 155 ForceDelete *bool `pulumi:"forceDelete"` 156 // S3 object that is the Application Version source bundle. 157 Key *string `pulumi:"key"` 158 // Unique name for the this Application Version. 159 // 160 // The following arguments are optional: 161 Name *string `pulumi:"name"` 162 // Key-value map of tags for the Elastic Beanstalk Application Version. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 163 Tags map[string]string `pulumi:"tags"` 164 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 165 // 166 // Deprecated: Please use `tags` instead. 167 TagsAll map[string]string `pulumi:"tagsAll"` 168 } 169 170 type ApplicationVersionState struct { 171 // Name of the Beanstalk Application the version is associated with. 172 Application pulumi.Input 173 // ARN assigned by AWS for this Elastic Beanstalk Application. 174 Arn pulumi.StringPtrInput 175 // S3 bucket that contains the Application Version source bundle. 176 Bucket pulumi.Input 177 // Short description of the Application Version. 178 Description pulumi.StringPtrInput 179 // On delete, force an Application Version to be deleted when it may be in use by multiple Elastic Beanstalk Environments. 180 ForceDelete pulumi.BoolPtrInput 181 // S3 object that is the Application Version source bundle. 182 Key pulumi.StringPtrInput 183 // Unique name for the this Application Version. 184 // 185 // The following arguments are optional: 186 Name pulumi.StringPtrInput 187 // Key-value map of tags for the Elastic Beanstalk Application Version. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 188 Tags pulumi.StringMapInput 189 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 190 // 191 // Deprecated: Please use `tags` instead. 192 TagsAll pulumi.StringMapInput 193 } 194 195 func (ApplicationVersionState) ElementType() reflect.Type { 196 return reflect.TypeOf((*applicationVersionState)(nil)).Elem() 197 } 198 199 type applicationVersionArgs struct { 200 // Name of the Beanstalk Application the version is associated with. 201 Application interface{} `pulumi:"application"` 202 // S3 bucket that contains the Application Version source bundle. 203 Bucket interface{} `pulumi:"bucket"` 204 // Short description of the Application Version. 205 Description *string `pulumi:"description"` 206 // On delete, force an Application Version to be deleted when it may be in use by multiple Elastic Beanstalk Environments. 207 ForceDelete *bool `pulumi:"forceDelete"` 208 // S3 object that is the Application Version source bundle. 209 Key string `pulumi:"key"` 210 // Unique name for the this Application Version. 211 // 212 // The following arguments are optional: 213 Name *string `pulumi:"name"` 214 // Key-value map of tags for the Elastic Beanstalk Application Version. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 215 Tags map[string]string `pulumi:"tags"` 216 } 217 218 // The set of arguments for constructing a ApplicationVersion resource. 219 type ApplicationVersionArgs struct { 220 // Name of the Beanstalk Application the version is associated with. 221 Application pulumi.Input 222 // S3 bucket that contains the Application Version source bundle. 223 Bucket pulumi.Input 224 // Short description of the Application Version. 225 Description pulumi.StringPtrInput 226 // On delete, force an Application Version to be deleted when it may be in use by multiple Elastic Beanstalk Environments. 227 ForceDelete pulumi.BoolPtrInput 228 // S3 object that is the Application Version source bundle. 229 Key pulumi.StringInput 230 // Unique name for the this Application Version. 231 // 232 // The following arguments are optional: 233 Name pulumi.StringPtrInput 234 // Key-value map of tags for the Elastic Beanstalk Application Version. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 235 Tags pulumi.StringMapInput 236 } 237 238 func (ApplicationVersionArgs) ElementType() reflect.Type { 239 return reflect.TypeOf((*applicationVersionArgs)(nil)).Elem() 240 } 241 242 type ApplicationVersionInput interface { 243 pulumi.Input 244 245 ToApplicationVersionOutput() ApplicationVersionOutput 246 ToApplicationVersionOutputWithContext(ctx context.Context) ApplicationVersionOutput 247 } 248 249 func (*ApplicationVersion) ElementType() reflect.Type { 250 return reflect.TypeOf((**ApplicationVersion)(nil)).Elem() 251 } 252 253 func (i *ApplicationVersion) ToApplicationVersionOutput() ApplicationVersionOutput { 254 return i.ToApplicationVersionOutputWithContext(context.Background()) 255 } 256 257 func (i *ApplicationVersion) ToApplicationVersionOutputWithContext(ctx context.Context) ApplicationVersionOutput { 258 return pulumi.ToOutputWithContext(ctx, i).(ApplicationVersionOutput) 259 } 260 261 // ApplicationVersionArrayInput is an input type that accepts ApplicationVersionArray and ApplicationVersionArrayOutput values. 262 // You can construct a concrete instance of `ApplicationVersionArrayInput` via: 263 // 264 // ApplicationVersionArray{ ApplicationVersionArgs{...} } 265 type ApplicationVersionArrayInput interface { 266 pulumi.Input 267 268 ToApplicationVersionArrayOutput() ApplicationVersionArrayOutput 269 ToApplicationVersionArrayOutputWithContext(context.Context) ApplicationVersionArrayOutput 270 } 271 272 type ApplicationVersionArray []ApplicationVersionInput 273 274 func (ApplicationVersionArray) ElementType() reflect.Type { 275 return reflect.TypeOf((*[]*ApplicationVersion)(nil)).Elem() 276 } 277 278 func (i ApplicationVersionArray) ToApplicationVersionArrayOutput() ApplicationVersionArrayOutput { 279 return i.ToApplicationVersionArrayOutputWithContext(context.Background()) 280 } 281 282 func (i ApplicationVersionArray) ToApplicationVersionArrayOutputWithContext(ctx context.Context) ApplicationVersionArrayOutput { 283 return pulumi.ToOutputWithContext(ctx, i).(ApplicationVersionArrayOutput) 284 } 285 286 // ApplicationVersionMapInput is an input type that accepts ApplicationVersionMap and ApplicationVersionMapOutput values. 287 // You can construct a concrete instance of `ApplicationVersionMapInput` via: 288 // 289 // ApplicationVersionMap{ "key": ApplicationVersionArgs{...} } 290 type ApplicationVersionMapInput interface { 291 pulumi.Input 292 293 ToApplicationVersionMapOutput() ApplicationVersionMapOutput 294 ToApplicationVersionMapOutputWithContext(context.Context) ApplicationVersionMapOutput 295 } 296 297 type ApplicationVersionMap map[string]ApplicationVersionInput 298 299 func (ApplicationVersionMap) ElementType() reflect.Type { 300 return reflect.TypeOf((*map[string]*ApplicationVersion)(nil)).Elem() 301 } 302 303 func (i ApplicationVersionMap) ToApplicationVersionMapOutput() ApplicationVersionMapOutput { 304 return i.ToApplicationVersionMapOutputWithContext(context.Background()) 305 } 306 307 func (i ApplicationVersionMap) ToApplicationVersionMapOutputWithContext(ctx context.Context) ApplicationVersionMapOutput { 308 return pulumi.ToOutputWithContext(ctx, i).(ApplicationVersionMapOutput) 309 } 310 311 type ApplicationVersionOutput struct{ *pulumi.OutputState } 312 313 func (ApplicationVersionOutput) ElementType() reflect.Type { 314 return reflect.TypeOf((**ApplicationVersion)(nil)).Elem() 315 } 316 317 func (o ApplicationVersionOutput) ToApplicationVersionOutput() ApplicationVersionOutput { 318 return o 319 } 320 321 func (o ApplicationVersionOutput) ToApplicationVersionOutputWithContext(ctx context.Context) ApplicationVersionOutput { 322 return o 323 } 324 325 // Name of the Beanstalk Application the version is associated with. 326 func (o ApplicationVersionOutput) Application() pulumi.StringOutput { 327 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringOutput { return v.Application }).(pulumi.StringOutput) 328 } 329 330 // ARN assigned by AWS for this Elastic Beanstalk Application. 331 func (o ApplicationVersionOutput) Arn() pulumi.StringOutput { 332 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 333 } 334 335 // S3 bucket that contains the Application Version source bundle. 336 func (o ApplicationVersionOutput) Bucket() pulumi.StringOutput { 337 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringOutput { return v.Bucket }).(pulumi.StringOutput) 338 } 339 340 // Short description of the Application Version. 341 func (o ApplicationVersionOutput) Description() pulumi.StringPtrOutput { 342 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 343 } 344 345 // On delete, force an Application Version to be deleted when it may be in use by multiple Elastic Beanstalk Environments. 346 func (o ApplicationVersionOutput) ForceDelete() pulumi.BoolPtrOutput { 347 return o.ApplyT(func(v *ApplicationVersion) pulumi.BoolPtrOutput { return v.ForceDelete }).(pulumi.BoolPtrOutput) 348 } 349 350 // S3 object that is the Application Version source bundle. 351 func (o ApplicationVersionOutput) Key() pulumi.StringOutput { 352 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringOutput { return v.Key }).(pulumi.StringOutput) 353 } 354 355 // Unique name for the this Application Version. 356 // 357 // The following arguments are optional: 358 func (o ApplicationVersionOutput) Name() pulumi.StringOutput { 359 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 360 } 361 362 // Key-value map of tags for the Elastic Beanstalk Application Version. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 363 func (o ApplicationVersionOutput) Tags() pulumi.StringMapOutput { 364 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 365 } 366 367 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 368 // 369 // Deprecated: Please use `tags` instead. 370 func (o ApplicationVersionOutput) TagsAll() pulumi.StringMapOutput { 371 return o.ApplyT(func(v *ApplicationVersion) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 372 } 373 374 type ApplicationVersionArrayOutput struct{ *pulumi.OutputState } 375 376 func (ApplicationVersionArrayOutput) ElementType() reflect.Type { 377 return reflect.TypeOf((*[]*ApplicationVersion)(nil)).Elem() 378 } 379 380 func (o ApplicationVersionArrayOutput) ToApplicationVersionArrayOutput() ApplicationVersionArrayOutput { 381 return o 382 } 383 384 func (o ApplicationVersionArrayOutput) ToApplicationVersionArrayOutputWithContext(ctx context.Context) ApplicationVersionArrayOutput { 385 return o 386 } 387 388 func (o ApplicationVersionArrayOutput) Index(i pulumi.IntInput) ApplicationVersionOutput { 389 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApplicationVersion { 390 return vs[0].([]*ApplicationVersion)[vs[1].(int)] 391 }).(ApplicationVersionOutput) 392 } 393 394 type ApplicationVersionMapOutput struct{ *pulumi.OutputState } 395 396 func (ApplicationVersionMapOutput) ElementType() reflect.Type { 397 return reflect.TypeOf((*map[string]*ApplicationVersion)(nil)).Elem() 398 } 399 400 func (o ApplicationVersionMapOutput) ToApplicationVersionMapOutput() ApplicationVersionMapOutput { 401 return o 402 } 403 404 func (o ApplicationVersionMapOutput) ToApplicationVersionMapOutputWithContext(ctx context.Context) ApplicationVersionMapOutput { 405 return o 406 } 407 408 func (o ApplicationVersionMapOutput) MapIndex(k pulumi.StringInput) ApplicationVersionOutput { 409 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApplicationVersion { 410 return vs[0].(map[string]*ApplicationVersion)[vs[1].(string)] 411 }).(ApplicationVersionOutput) 412 } 413 414 func init() { 415 pulumi.RegisterInputType(reflect.TypeOf((*ApplicationVersionInput)(nil)).Elem(), &ApplicationVersion{}) 416 pulumi.RegisterInputType(reflect.TypeOf((*ApplicationVersionArrayInput)(nil)).Elem(), ApplicationVersionArray{}) 417 pulumi.RegisterInputType(reflect.TypeOf((*ApplicationVersionMapInput)(nil)).Elem(), ApplicationVersionMap{}) 418 pulumi.RegisterOutputType(ApplicationVersionOutput{}) 419 pulumi.RegisterOutputType(ApplicationVersionArrayOutput{}) 420 pulumi.RegisterOutputType(ApplicationVersionMapOutput{}) 421 }