github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/controltower/getControls.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 controltower
     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  // List of Control Tower controls applied to an OU.
    15  func GetControls(ctx *pulumi.Context, args *GetControlsArgs, opts ...pulumi.InvokeOption) (*GetControlsResult, error) {
    16  	opts = internal.PkgInvokeDefaultOpts(opts)
    17  	var rv GetControlsResult
    18  	err := ctx.Invoke("aws:controltower/getControls:getControls", args, &rv, opts...)
    19  	if err != nil {
    20  		return nil, err
    21  	}
    22  	return &rv, nil
    23  }
    24  
    25  // A collection of arguments for invoking getControls.
    26  type GetControlsArgs struct {
    27  	// The ARN of the organizational unit.
    28  	TargetIdentifier string `pulumi:"targetIdentifier"`
    29  }
    30  
    31  // A collection of values returned by getControls.
    32  type GetControlsResult struct {
    33  	// List of all the ARNs for the controls applied to the `targetIdentifier`.
    34  	EnabledControls []string `pulumi:"enabledControls"`
    35  	// The provider-assigned unique ID for this managed resource.
    36  	Id               string `pulumi:"id"`
    37  	TargetIdentifier string `pulumi:"targetIdentifier"`
    38  }
    39  
    40  func GetControlsOutput(ctx *pulumi.Context, args GetControlsOutputArgs, opts ...pulumi.InvokeOption) GetControlsResultOutput {
    41  	return pulumi.ToOutputWithContext(context.Background(), args).
    42  		ApplyT(func(v interface{}) (GetControlsResult, error) {
    43  			args := v.(GetControlsArgs)
    44  			r, err := GetControls(ctx, &args, opts...)
    45  			var s GetControlsResult
    46  			if r != nil {
    47  				s = *r
    48  			}
    49  			return s, err
    50  		}).(GetControlsResultOutput)
    51  }
    52  
    53  // A collection of arguments for invoking getControls.
    54  type GetControlsOutputArgs struct {
    55  	// The ARN of the organizational unit.
    56  	TargetIdentifier pulumi.StringInput `pulumi:"targetIdentifier"`
    57  }
    58  
    59  func (GetControlsOutputArgs) ElementType() reflect.Type {
    60  	return reflect.TypeOf((*GetControlsArgs)(nil)).Elem()
    61  }
    62  
    63  // A collection of values returned by getControls.
    64  type GetControlsResultOutput struct{ *pulumi.OutputState }
    65  
    66  func (GetControlsResultOutput) ElementType() reflect.Type {
    67  	return reflect.TypeOf((*GetControlsResult)(nil)).Elem()
    68  }
    69  
    70  func (o GetControlsResultOutput) ToGetControlsResultOutput() GetControlsResultOutput {
    71  	return o
    72  }
    73  
    74  func (o GetControlsResultOutput) ToGetControlsResultOutputWithContext(ctx context.Context) GetControlsResultOutput {
    75  	return o
    76  }
    77  
    78  // List of all the ARNs for the controls applied to the `targetIdentifier`.
    79  func (o GetControlsResultOutput) EnabledControls() pulumi.StringArrayOutput {
    80  	return o.ApplyT(func(v GetControlsResult) []string { return v.EnabledControls }).(pulumi.StringArrayOutput)
    81  }
    82  
    83  // The provider-assigned unique ID for this managed resource.
    84  func (o GetControlsResultOutput) Id() pulumi.StringOutput {
    85  	return o.ApplyT(func(v GetControlsResult) string { return v.Id }).(pulumi.StringOutput)
    86  }
    87  
    88  func (o GetControlsResultOutput) TargetIdentifier() pulumi.StringOutput {
    89  	return o.ApplyT(func(v GetControlsResult) string { return v.TargetIdentifier }).(pulumi.StringOutput)
    90  }
    91  
    92  func init() {
    93  	pulumi.RegisterOutputType(GetControlsResultOutput{})
    94  }