github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/organizations/getDelegatedServices.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 organizations
     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  // Get a list the AWS services for which the specified account is a delegated administrator
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/organizations"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := organizations.GetDelegatedServices(ctx, &organizations.GetDelegatedServicesArgs{
    32  //				AccountId: "AWS ACCOUNT ID",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func GetDelegatedServices(ctx *pulumi.Context, args *GetDelegatedServicesArgs, opts ...pulumi.InvokeOption) (*GetDelegatedServicesResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv GetDelegatedServicesResult
    46  	err := ctx.Invoke("aws:organizations/getDelegatedServices:getDelegatedServices", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getDelegatedServices.
    54  type GetDelegatedServicesArgs struct {
    55  	// Account ID number of a delegated administrator account in the organization.
    56  	AccountId string `pulumi:"accountId"`
    57  }
    58  
    59  // A collection of values returned by getDelegatedServices.
    60  type GetDelegatedServicesResult struct {
    61  	AccountId string `pulumi:"accountId"`
    62  	// Services for which the account is a delegated administrator, which have the following attributes:
    63  	DelegatedServices []GetDelegatedServicesDelegatedService `pulumi:"delegatedServices"`
    64  	// The provider-assigned unique ID for this managed resource.
    65  	Id string `pulumi:"id"`
    66  }
    67  
    68  func GetDelegatedServicesOutput(ctx *pulumi.Context, args GetDelegatedServicesOutputArgs, opts ...pulumi.InvokeOption) GetDelegatedServicesResultOutput {
    69  	return pulumi.ToOutputWithContext(context.Background(), args).
    70  		ApplyT(func(v interface{}) (GetDelegatedServicesResult, error) {
    71  			args := v.(GetDelegatedServicesArgs)
    72  			r, err := GetDelegatedServices(ctx, &args, opts...)
    73  			var s GetDelegatedServicesResult
    74  			if r != nil {
    75  				s = *r
    76  			}
    77  			return s, err
    78  		}).(GetDelegatedServicesResultOutput)
    79  }
    80  
    81  // A collection of arguments for invoking getDelegatedServices.
    82  type GetDelegatedServicesOutputArgs struct {
    83  	// Account ID number of a delegated administrator account in the organization.
    84  	AccountId pulumi.StringInput `pulumi:"accountId"`
    85  }
    86  
    87  func (GetDelegatedServicesOutputArgs) ElementType() reflect.Type {
    88  	return reflect.TypeOf((*GetDelegatedServicesArgs)(nil)).Elem()
    89  }
    90  
    91  // A collection of values returned by getDelegatedServices.
    92  type GetDelegatedServicesResultOutput struct{ *pulumi.OutputState }
    93  
    94  func (GetDelegatedServicesResultOutput) ElementType() reflect.Type {
    95  	return reflect.TypeOf((*GetDelegatedServicesResult)(nil)).Elem()
    96  }
    97  
    98  func (o GetDelegatedServicesResultOutput) ToGetDelegatedServicesResultOutput() GetDelegatedServicesResultOutput {
    99  	return o
   100  }
   101  
   102  func (o GetDelegatedServicesResultOutput) ToGetDelegatedServicesResultOutputWithContext(ctx context.Context) GetDelegatedServicesResultOutput {
   103  	return o
   104  }
   105  
   106  func (o GetDelegatedServicesResultOutput) AccountId() pulumi.StringOutput {
   107  	return o.ApplyT(func(v GetDelegatedServicesResult) string { return v.AccountId }).(pulumi.StringOutput)
   108  }
   109  
   110  // Services for which the account is a delegated administrator, which have the following attributes:
   111  func (o GetDelegatedServicesResultOutput) DelegatedServices() GetDelegatedServicesDelegatedServiceArrayOutput {
   112  	return o.ApplyT(func(v GetDelegatedServicesResult) []GetDelegatedServicesDelegatedService { return v.DelegatedServices }).(GetDelegatedServicesDelegatedServiceArrayOutput)
   113  }
   114  
   115  // The provider-assigned unique ID for this managed resource.
   116  func (o GetDelegatedServicesResultOutput) Id() pulumi.StringOutput {
   117  	return o.ApplyT(func(v GetDelegatedServicesResult) string { return v.Id }).(pulumi.StringOutput)
   118  }
   119  
   120  func init() {
   121  	pulumi.RegisterOutputType(GetDelegatedServicesResultOutput{})
   122  }