github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/controltower/controlTowerControl.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 "errors" 11 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 12 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 13 ) 14 15 // Allows the application of pre-defined controls to organizational units. For more information on usage, please see the 16 // [AWS Control Tower User Guide](https://docs.aws.amazon.com/controltower/latest/userguide/enable-guardrails.html). 17 // 18 // ## Import 19 // 20 // Using `pulumi import`, import Control Tower Controls using their `organizational_unit_arn/control_identifier`. For example: 21 // 22 // ```sh 23 // $ pulumi import aws:controltower/controlTowerControl:ControlTowerControl example arn:aws:organizations::123456789101:ou/o-qqaejywet/ou-qg5o-ufbhdtv3,arn:aws:controltower:us-east-1::control/WTDSMKDKDNLE 24 // ``` 25 type ControlTowerControl struct { 26 pulumi.CustomResourceState 27 28 // The ARN of the control. Only Strongly recommended and Elective controls are permitted, with the exception of the Region deny guardrail. 29 ControlIdentifier pulumi.StringOutput `pulumi:"controlIdentifier"` 30 // The ARN of the organizational unit. 31 TargetIdentifier pulumi.StringOutput `pulumi:"targetIdentifier"` 32 } 33 34 // NewControlTowerControl registers a new resource with the given unique name, arguments, and options. 35 func NewControlTowerControl(ctx *pulumi.Context, 36 name string, args *ControlTowerControlArgs, opts ...pulumi.ResourceOption) (*ControlTowerControl, error) { 37 if args == nil { 38 return nil, errors.New("missing one or more required arguments") 39 } 40 41 if args.ControlIdentifier == nil { 42 return nil, errors.New("invalid value for required argument 'ControlIdentifier'") 43 } 44 if args.TargetIdentifier == nil { 45 return nil, errors.New("invalid value for required argument 'TargetIdentifier'") 46 } 47 opts = internal.PkgResourceDefaultOpts(opts) 48 var resource ControlTowerControl 49 err := ctx.RegisterResource("aws:controltower/controlTowerControl:ControlTowerControl", name, args, &resource, opts...) 50 if err != nil { 51 return nil, err 52 } 53 return &resource, nil 54 } 55 56 // GetControlTowerControl gets an existing ControlTowerControl resource's state with the given name, ID, and optional 57 // state properties that are used to uniquely qualify the lookup (nil if not required). 58 func GetControlTowerControl(ctx *pulumi.Context, 59 name string, id pulumi.IDInput, state *ControlTowerControlState, opts ...pulumi.ResourceOption) (*ControlTowerControl, error) { 60 var resource ControlTowerControl 61 err := ctx.ReadResource("aws:controltower/controlTowerControl:ControlTowerControl", name, id, state, &resource, opts...) 62 if err != nil { 63 return nil, err 64 } 65 return &resource, nil 66 } 67 68 // Input properties used for looking up and filtering ControlTowerControl resources. 69 type controlTowerControlState struct { 70 // The ARN of the control. Only Strongly recommended and Elective controls are permitted, with the exception of the Region deny guardrail. 71 ControlIdentifier *string `pulumi:"controlIdentifier"` 72 // The ARN of the organizational unit. 73 TargetIdentifier *string `pulumi:"targetIdentifier"` 74 } 75 76 type ControlTowerControlState struct { 77 // The ARN of the control. Only Strongly recommended and Elective controls are permitted, with the exception of the Region deny guardrail. 78 ControlIdentifier pulumi.StringPtrInput 79 // The ARN of the organizational unit. 80 TargetIdentifier pulumi.StringPtrInput 81 } 82 83 func (ControlTowerControlState) ElementType() reflect.Type { 84 return reflect.TypeOf((*controlTowerControlState)(nil)).Elem() 85 } 86 87 type controlTowerControlArgs struct { 88 // The ARN of the control. Only Strongly recommended and Elective controls are permitted, with the exception of the Region deny guardrail. 89 ControlIdentifier string `pulumi:"controlIdentifier"` 90 // The ARN of the organizational unit. 91 TargetIdentifier string `pulumi:"targetIdentifier"` 92 } 93 94 // The set of arguments for constructing a ControlTowerControl resource. 95 type ControlTowerControlArgs struct { 96 // The ARN of the control. Only Strongly recommended and Elective controls are permitted, with the exception of the Region deny guardrail. 97 ControlIdentifier pulumi.StringInput 98 // The ARN of the organizational unit. 99 TargetIdentifier pulumi.StringInput 100 } 101 102 func (ControlTowerControlArgs) ElementType() reflect.Type { 103 return reflect.TypeOf((*controlTowerControlArgs)(nil)).Elem() 104 } 105 106 type ControlTowerControlInput interface { 107 pulumi.Input 108 109 ToControlTowerControlOutput() ControlTowerControlOutput 110 ToControlTowerControlOutputWithContext(ctx context.Context) ControlTowerControlOutput 111 } 112 113 func (*ControlTowerControl) ElementType() reflect.Type { 114 return reflect.TypeOf((**ControlTowerControl)(nil)).Elem() 115 } 116 117 func (i *ControlTowerControl) ToControlTowerControlOutput() ControlTowerControlOutput { 118 return i.ToControlTowerControlOutputWithContext(context.Background()) 119 } 120 121 func (i *ControlTowerControl) ToControlTowerControlOutputWithContext(ctx context.Context) ControlTowerControlOutput { 122 return pulumi.ToOutputWithContext(ctx, i).(ControlTowerControlOutput) 123 } 124 125 // ControlTowerControlArrayInput is an input type that accepts ControlTowerControlArray and ControlTowerControlArrayOutput values. 126 // You can construct a concrete instance of `ControlTowerControlArrayInput` via: 127 // 128 // ControlTowerControlArray{ ControlTowerControlArgs{...} } 129 type ControlTowerControlArrayInput interface { 130 pulumi.Input 131 132 ToControlTowerControlArrayOutput() ControlTowerControlArrayOutput 133 ToControlTowerControlArrayOutputWithContext(context.Context) ControlTowerControlArrayOutput 134 } 135 136 type ControlTowerControlArray []ControlTowerControlInput 137 138 func (ControlTowerControlArray) ElementType() reflect.Type { 139 return reflect.TypeOf((*[]*ControlTowerControl)(nil)).Elem() 140 } 141 142 func (i ControlTowerControlArray) ToControlTowerControlArrayOutput() ControlTowerControlArrayOutput { 143 return i.ToControlTowerControlArrayOutputWithContext(context.Background()) 144 } 145 146 func (i ControlTowerControlArray) ToControlTowerControlArrayOutputWithContext(ctx context.Context) ControlTowerControlArrayOutput { 147 return pulumi.ToOutputWithContext(ctx, i).(ControlTowerControlArrayOutput) 148 } 149 150 // ControlTowerControlMapInput is an input type that accepts ControlTowerControlMap and ControlTowerControlMapOutput values. 151 // You can construct a concrete instance of `ControlTowerControlMapInput` via: 152 // 153 // ControlTowerControlMap{ "key": ControlTowerControlArgs{...} } 154 type ControlTowerControlMapInput interface { 155 pulumi.Input 156 157 ToControlTowerControlMapOutput() ControlTowerControlMapOutput 158 ToControlTowerControlMapOutputWithContext(context.Context) ControlTowerControlMapOutput 159 } 160 161 type ControlTowerControlMap map[string]ControlTowerControlInput 162 163 func (ControlTowerControlMap) ElementType() reflect.Type { 164 return reflect.TypeOf((*map[string]*ControlTowerControl)(nil)).Elem() 165 } 166 167 func (i ControlTowerControlMap) ToControlTowerControlMapOutput() ControlTowerControlMapOutput { 168 return i.ToControlTowerControlMapOutputWithContext(context.Background()) 169 } 170 171 func (i ControlTowerControlMap) ToControlTowerControlMapOutputWithContext(ctx context.Context) ControlTowerControlMapOutput { 172 return pulumi.ToOutputWithContext(ctx, i).(ControlTowerControlMapOutput) 173 } 174 175 type ControlTowerControlOutput struct{ *pulumi.OutputState } 176 177 func (ControlTowerControlOutput) ElementType() reflect.Type { 178 return reflect.TypeOf((**ControlTowerControl)(nil)).Elem() 179 } 180 181 func (o ControlTowerControlOutput) ToControlTowerControlOutput() ControlTowerControlOutput { 182 return o 183 } 184 185 func (o ControlTowerControlOutput) ToControlTowerControlOutputWithContext(ctx context.Context) ControlTowerControlOutput { 186 return o 187 } 188 189 // The ARN of the control. Only Strongly recommended and Elective controls are permitted, with the exception of the Region deny guardrail. 190 func (o ControlTowerControlOutput) ControlIdentifier() pulumi.StringOutput { 191 return o.ApplyT(func(v *ControlTowerControl) pulumi.StringOutput { return v.ControlIdentifier }).(pulumi.StringOutput) 192 } 193 194 // The ARN of the organizational unit. 195 func (o ControlTowerControlOutput) TargetIdentifier() pulumi.StringOutput { 196 return o.ApplyT(func(v *ControlTowerControl) pulumi.StringOutput { return v.TargetIdentifier }).(pulumi.StringOutput) 197 } 198 199 type ControlTowerControlArrayOutput struct{ *pulumi.OutputState } 200 201 func (ControlTowerControlArrayOutput) ElementType() reflect.Type { 202 return reflect.TypeOf((*[]*ControlTowerControl)(nil)).Elem() 203 } 204 205 func (o ControlTowerControlArrayOutput) ToControlTowerControlArrayOutput() ControlTowerControlArrayOutput { 206 return o 207 } 208 209 func (o ControlTowerControlArrayOutput) ToControlTowerControlArrayOutputWithContext(ctx context.Context) ControlTowerControlArrayOutput { 210 return o 211 } 212 213 func (o ControlTowerControlArrayOutput) Index(i pulumi.IntInput) ControlTowerControlOutput { 214 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ControlTowerControl { 215 return vs[0].([]*ControlTowerControl)[vs[1].(int)] 216 }).(ControlTowerControlOutput) 217 } 218 219 type ControlTowerControlMapOutput struct{ *pulumi.OutputState } 220 221 func (ControlTowerControlMapOutput) ElementType() reflect.Type { 222 return reflect.TypeOf((*map[string]*ControlTowerControl)(nil)).Elem() 223 } 224 225 func (o ControlTowerControlMapOutput) ToControlTowerControlMapOutput() ControlTowerControlMapOutput { 226 return o 227 } 228 229 func (o ControlTowerControlMapOutput) ToControlTowerControlMapOutputWithContext(ctx context.Context) ControlTowerControlMapOutput { 230 return o 231 } 232 233 func (o ControlTowerControlMapOutput) MapIndex(k pulumi.StringInput) ControlTowerControlOutput { 234 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ControlTowerControl { 235 return vs[0].(map[string]*ControlTowerControl)[vs[1].(string)] 236 }).(ControlTowerControlOutput) 237 } 238 239 func init() { 240 pulumi.RegisterInputType(reflect.TypeOf((*ControlTowerControlInput)(nil)).Elem(), &ControlTowerControl{}) 241 pulumi.RegisterInputType(reflect.TypeOf((*ControlTowerControlArrayInput)(nil)).Elem(), ControlTowerControlArray{}) 242 pulumi.RegisterInputType(reflect.TypeOf((*ControlTowerControlMapInput)(nil)).Elem(), ControlTowerControlMap{}) 243 pulumi.RegisterOutputType(ControlTowerControlOutput{}) 244 pulumi.RegisterOutputType(ControlTowerControlArrayOutput{}) 245 pulumi.RegisterOutputType(ControlTowerControlMapOutput{}) 246 }