github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/organizations/getPoliciesForTarget.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 // Data source for managing an AWS Organizations Policies For Target. 15 // 16 // ## Example Usage 17 func GetPoliciesForTarget(ctx *pulumi.Context, args *GetPoliciesForTargetArgs, opts ...pulumi.InvokeOption) (*GetPoliciesForTargetResult, error) { 18 opts = internal.PkgInvokeDefaultOpts(opts) 19 var rv GetPoliciesForTargetResult 20 err := ctx.Invoke("aws:organizations/getPoliciesForTarget:getPoliciesForTarget", args, &rv, opts...) 21 if err != nil { 22 return nil, err 23 } 24 return &rv, nil 25 } 26 27 // A collection of arguments for invoking getPoliciesForTarget. 28 type GetPoliciesForTargetArgs struct { 29 // Must supply one of the 4 different policy filters for a target (SERVICE_CONTROL_POLICY | TAG_POLICY | BACKUP_POLICY | AISERVICES_OPT_OUT_POLICY) 30 Filter string `pulumi:"filter"` 31 // The root (string that begins with "r-" followed by 4-32 lowercase letters or digits), account (12 digit string), or Organizational Unit (string starting with "ou-" followed by 4-32 lowercase letters or digits. This string is followed by a second "-" dash and from 8-32 additional lowercase letters or digits.) 32 TargetId string `pulumi:"targetId"` 33 } 34 35 // A collection of values returned by getPoliciesForTarget. 36 type GetPoliciesForTargetResult struct { 37 Filter string `pulumi:"filter"` 38 // The provider-assigned unique ID for this managed resource. 39 Id string `pulumi:"id"` 40 // List of all the policy ids found. 41 Ids []string `pulumi:"ids"` 42 TargetId string `pulumi:"targetId"` 43 } 44 45 func GetPoliciesForTargetOutput(ctx *pulumi.Context, args GetPoliciesForTargetOutputArgs, opts ...pulumi.InvokeOption) GetPoliciesForTargetResultOutput { 46 return pulumi.ToOutputWithContext(context.Background(), args). 47 ApplyT(func(v interface{}) (GetPoliciesForTargetResult, error) { 48 args := v.(GetPoliciesForTargetArgs) 49 r, err := GetPoliciesForTarget(ctx, &args, opts...) 50 var s GetPoliciesForTargetResult 51 if r != nil { 52 s = *r 53 } 54 return s, err 55 }).(GetPoliciesForTargetResultOutput) 56 } 57 58 // A collection of arguments for invoking getPoliciesForTarget. 59 type GetPoliciesForTargetOutputArgs struct { 60 // Must supply one of the 4 different policy filters for a target (SERVICE_CONTROL_POLICY | TAG_POLICY | BACKUP_POLICY | AISERVICES_OPT_OUT_POLICY) 61 Filter pulumi.StringInput `pulumi:"filter"` 62 // The root (string that begins with "r-" followed by 4-32 lowercase letters or digits), account (12 digit string), or Organizational Unit (string starting with "ou-" followed by 4-32 lowercase letters or digits. This string is followed by a second "-" dash and from 8-32 additional lowercase letters or digits.) 63 TargetId pulumi.StringInput `pulumi:"targetId"` 64 } 65 66 func (GetPoliciesForTargetOutputArgs) ElementType() reflect.Type { 67 return reflect.TypeOf((*GetPoliciesForTargetArgs)(nil)).Elem() 68 } 69 70 // A collection of values returned by getPoliciesForTarget. 71 type GetPoliciesForTargetResultOutput struct{ *pulumi.OutputState } 72 73 func (GetPoliciesForTargetResultOutput) ElementType() reflect.Type { 74 return reflect.TypeOf((*GetPoliciesForTargetResult)(nil)).Elem() 75 } 76 77 func (o GetPoliciesForTargetResultOutput) ToGetPoliciesForTargetResultOutput() GetPoliciesForTargetResultOutput { 78 return o 79 } 80 81 func (o GetPoliciesForTargetResultOutput) ToGetPoliciesForTargetResultOutputWithContext(ctx context.Context) GetPoliciesForTargetResultOutput { 82 return o 83 } 84 85 func (o GetPoliciesForTargetResultOutput) Filter() pulumi.StringOutput { 86 return o.ApplyT(func(v GetPoliciesForTargetResult) string { return v.Filter }).(pulumi.StringOutput) 87 } 88 89 // The provider-assigned unique ID for this managed resource. 90 func (o GetPoliciesForTargetResultOutput) Id() pulumi.StringOutput { 91 return o.ApplyT(func(v GetPoliciesForTargetResult) string { return v.Id }).(pulumi.StringOutput) 92 } 93 94 // List of all the policy ids found. 95 func (o GetPoliciesForTargetResultOutput) Ids() pulumi.StringArrayOutput { 96 return o.ApplyT(func(v GetPoliciesForTargetResult) []string { return v.Ids }).(pulumi.StringArrayOutput) 97 } 98 99 func (o GetPoliciesForTargetResultOutput) TargetId() pulumi.StringOutput { 100 return o.ApplyT(func(v GetPoliciesForTargetResult) string { return v.TargetId }).(pulumi.StringOutput) 101 } 102 103 func init() { 104 pulumi.RegisterOutputType(GetPoliciesForTargetResultOutput{}) 105 }