github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appconfig/getEnvironments.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 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides access to all Environments for an AppConfig Application. This will allow you to pass Environment IDs to another 15 // resource. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/appconfig" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := appconfig.GetEnvironments(ctx, &appconfig.GetEnvironmentsArgs{ 35 // ApplicationId: "a1d3rpe", 36 // }, nil) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 func GetEnvironments(ctx *pulumi.Context, args *GetEnvironmentsArgs, opts ...pulumi.InvokeOption) (*GetEnvironmentsResult, error) { 47 opts = internal.PkgInvokeDefaultOpts(opts) 48 var rv GetEnvironmentsResult 49 err := ctx.Invoke("aws:appconfig/getEnvironments:getEnvironments", args, &rv, opts...) 50 if err != nil { 51 return nil, err 52 } 53 return &rv, nil 54 } 55 56 // A collection of arguments for invoking getEnvironments. 57 type GetEnvironmentsArgs struct { 58 // ID of the AppConfig Application. 59 ApplicationId string `pulumi:"applicationId"` 60 } 61 62 // A collection of values returned by getEnvironments. 63 type GetEnvironmentsResult struct { 64 ApplicationId string `pulumi:"applicationId"` 65 // Set of Environment IDs associated with this AppConfig Application. 66 EnvironmentIds []string `pulumi:"environmentIds"` 67 // The provider-assigned unique ID for this managed resource. 68 Id string `pulumi:"id"` 69 } 70 71 func GetEnvironmentsOutput(ctx *pulumi.Context, args GetEnvironmentsOutputArgs, opts ...pulumi.InvokeOption) GetEnvironmentsResultOutput { 72 return pulumi.ToOutputWithContext(context.Background(), args). 73 ApplyT(func(v interface{}) (GetEnvironmentsResult, error) { 74 args := v.(GetEnvironmentsArgs) 75 r, err := GetEnvironments(ctx, &args, opts...) 76 var s GetEnvironmentsResult 77 if r != nil { 78 s = *r 79 } 80 return s, err 81 }).(GetEnvironmentsResultOutput) 82 } 83 84 // A collection of arguments for invoking getEnvironments. 85 type GetEnvironmentsOutputArgs struct { 86 // ID of the AppConfig Application. 87 ApplicationId pulumi.StringInput `pulumi:"applicationId"` 88 } 89 90 func (GetEnvironmentsOutputArgs) ElementType() reflect.Type { 91 return reflect.TypeOf((*GetEnvironmentsArgs)(nil)).Elem() 92 } 93 94 // A collection of values returned by getEnvironments. 95 type GetEnvironmentsResultOutput struct{ *pulumi.OutputState } 96 97 func (GetEnvironmentsResultOutput) ElementType() reflect.Type { 98 return reflect.TypeOf((*GetEnvironmentsResult)(nil)).Elem() 99 } 100 101 func (o GetEnvironmentsResultOutput) ToGetEnvironmentsResultOutput() GetEnvironmentsResultOutput { 102 return o 103 } 104 105 func (o GetEnvironmentsResultOutput) ToGetEnvironmentsResultOutputWithContext(ctx context.Context) GetEnvironmentsResultOutput { 106 return o 107 } 108 109 func (o GetEnvironmentsResultOutput) ApplicationId() pulumi.StringOutput { 110 return o.ApplyT(func(v GetEnvironmentsResult) string { return v.ApplicationId }).(pulumi.StringOutput) 111 } 112 113 // Set of Environment IDs associated with this AppConfig Application. 114 func (o GetEnvironmentsResultOutput) EnvironmentIds() pulumi.StringArrayOutput { 115 return o.ApplyT(func(v GetEnvironmentsResult) []string { return v.EnvironmentIds }).(pulumi.StringArrayOutput) 116 } 117 118 // The provider-assigned unique ID for this managed resource. 119 func (o GetEnvironmentsResultOutput) Id() pulumi.StringOutput { 120 return o.ApplyT(func(v GetEnvironmentsResult) string { return v.Id }).(pulumi.StringOutput) 121 } 122 123 func init() { 124 pulumi.RegisterOutputType(GetEnvironmentsResultOutput{}) 125 }