github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/organizations/organization.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 // Provides a resource to create an organization. 15 // 16 // !> **WARNING:** When migrating from a `featureSet` of `CONSOLIDATED_BILLING` to `ALL`, the Organization account owner will received an email stating the following: "You started the process to enable all features for your AWS organization. As part of that process, all member accounts that joined your organization by invitation must approve the change. You don’t need approval from member accounts that you directly created from within your AWS organization." After all member accounts have accepted the invitation, the Organization account owner must then finalize the changes via the [AWS Console](https://console.aws.amazon.com/organizations/home#/organization/settings/migration-progress). Until these steps are performed, the provider will perpetually show a difference, and the `DescribeOrganization` API will continue to show the `FeatureSet` as `CONSOLIDATED_BILLING`. See the [AWS Organizations documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) for more information. 17 // 18 // !> **WARNING:** [Warning from the AWS Docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html): "We recommend that you enable integration between AWS Organizations and the specified AWS service by using the console or commands that are provided by the specified service. Doing so ensures that the service is aware that it can create the resources that are required for the integration. How the service creates those resources in the organization's accounts depends on that service. For more information, see the documentation for the other AWS service." 19 // 20 // ## Example Usage 21 // 22 // <!--Start PulumiCodeChooser --> 23 // ```go 24 // package main 25 // 26 // import ( 27 // 28 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/organizations" 29 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 30 // 31 // ) 32 // 33 // func main() { 34 // pulumi.Run(func(ctx *pulumi.Context) error { 35 // _, err := organizations.NewOrganization(ctx, "org", &organizations.OrganizationArgs{ 36 // AwsServiceAccessPrincipals: pulumi.StringArray{ 37 // pulumi.String("cloudtrail.amazonaws.com"), 38 // pulumi.String("config.amazonaws.com"), 39 // }, 40 // FeatureSet: pulumi.String("ALL"), 41 // }) 42 // if err != nil { 43 // return err 44 // } 45 // return nil 46 // }) 47 // } 48 // 49 // ``` 50 // <!--End PulumiCodeChooser --> 51 // 52 // ## Import 53 // 54 // Using `pulumi import`, import the AWS organization using the `id`. For example: 55 // 56 // ```sh 57 // $ pulumi import aws:organizations/organization:Organization my_org o-1234567 58 // ``` 59 type Organization struct { 60 pulumi.CustomResourceState 61 62 // List of organization accounts including the master account. For a list excluding the master account, see the `nonMasterAccounts` attribute. All elements have these attributes: 63 Accounts OrganizationAccountArrayOutput `pulumi:"accounts"` 64 // ARN of the root 65 Arn pulumi.StringOutput `pulumi:"arn"` 66 // List of AWS service principal names for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. Organization must have `featureSet` set to `ALL`. Some services do not support enablement via this endpoint, see [warning in aws docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). 67 AwsServiceAccessPrincipals pulumi.StringArrayOutput `pulumi:"awsServiceAccessPrincipals"` 68 // List of Organizations policy types to enable in the Organization Root. Organization must have `featureSet` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). 69 EnabledPolicyTypes pulumi.StringArrayOutput `pulumi:"enabledPolicyTypes"` 70 // Specify "ALL" (default) or "CONSOLIDATED_BILLING". 71 FeatureSet pulumi.StringPtrOutput `pulumi:"featureSet"` 72 // ARN of the master account 73 MasterAccountArn pulumi.StringOutput `pulumi:"masterAccountArn"` 74 // Email address of the master account 75 MasterAccountEmail pulumi.StringOutput `pulumi:"masterAccountEmail"` 76 // Identifier of the master account 77 MasterAccountId pulumi.StringOutput `pulumi:"masterAccountId"` 78 // Name of the master account 79 MasterAccountName pulumi.StringOutput `pulumi:"masterAccountName"` 80 // List of organization accounts excluding the master account. For a list including the master account, see the `accounts` attribute. All elements have these attributes: 81 NonMasterAccounts OrganizationNonMasterAccountArrayOutput `pulumi:"nonMasterAccounts"` 82 // List of organization roots. All elements have these attributes: 83 Roots OrganizationRootArrayOutput `pulumi:"roots"` 84 } 85 86 // NewOrganization registers a new resource with the given unique name, arguments, and options. 87 func NewOrganization(ctx *pulumi.Context, 88 name string, args *OrganizationArgs, opts ...pulumi.ResourceOption) (*Organization, error) { 89 if args == nil { 90 args = &OrganizationArgs{} 91 } 92 93 opts = internal.PkgResourceDefaultOpts(opts) 94 var resource Organization 95 err := ctx.RegisterResource("aws:organizations/organization:Organization", name, args, &resource, opts...) 96 if err != nil { 97 return nil, err 98 } 99 return &resource, nil 100 } 101 102 // GetOrganization gets an existing Organization resource's state with the given name, ID, and optional 103 // state properties that are used to uniquely qualify the lookup (nil if not required). 104 func GetOrganization(ctx *pulumi.Context, 105 name string, id pulumi.IDInput, state *OrganizationState, opts ...pulumi.ResourceOption) (*Organization, error) { 106 var resource Organization 107 err := ctx.ReadResource("aws:organizations/organization:Organization", name, id, state, &resource, opts...) 108 if err != nil { 109 return nil, err 110 } 111 return &resource, nil 112 } 113 114 // Input properties used for looking up and filtering Organization resources. 115 type organizationState struct { 116 // List of organization accounts including the master account. For a list excluding the master account, see the `nonMasterAccounts` attribute. All elements have these attributes: 117 Accounts []OrganizationAccount `pulumi:"accounts"` 118 // ARN of the root 119 Arn *string `pulumi:"arn"` 120 // List of AWS service principal names for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. Organization must have `featureSet` set to `ALL`. Some services do not support enablement via this endpoint, see [warning in aws docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). 121 AwsServiceAccessPrincipals []string `pulumi:"awsServiceAccessPrincipals"` 122 // List of Organizations policy types to enable in the Organization Root. Organization must have `featureSet` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). 123 EnabledPolicyTypes []string `pulumi:"enabledPolicyTypes"` 124 // Specify "ALL" (default) or "CONSOLIDATED_BILLING". 125 FeatureSet *string `pulumi:"featureSet"` 126 // ARN of the master account 127 MasterAccountArn *string `pulumi:"masterAccountArn"` 128 // Email address of the master account 129 MasterAccountEmail *string `pulumi:"masterAccountEmail"` 130 // Identifier of the master account 131 MasterAccountId *string `pulumi:"masterAccountId"` 132 // Name of the master account 133 MasterAccountName *string `pulumi:"masterAccountName"` 134 // List of organization accounts excluding the master account. For a list including the master account, see the `accounts` attribute. All elements have these attributes: 135 NonMasterAccounts []OrganizationNonMasterAccount `pulumi:"nonMasterAccounts"` 136 // List of organization roots. All elements have these attributes: 137 Roots []OrganizationRoot `pulumi:"roots"` 138 } 139 140 type OrganizationState struct { 141 // List of organization accounts including the master account. For a list excluding the master account, see the `nonMasterAccounts` attribute. All elements have these attributes: 142 Accounts OrganizationAccountArrayInput 143 // ARN of the root 144 Arn pulumi.StringPtrInput 145 // List of AWS service principal names for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. Organization must have `featureSet` set to `ALL`. Some services do not support enablement via this endpoint, see [warning in aws docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). 146 AwsServiceAccessPrincipals pulumi.StringArrayInput 147 // List of Organizations policy types to enable in the Organization Root. Organization must have `featureSet` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). 148 EnabledPolicyTypes pulumi.StringArrayInput 149 // Specify "ALL" (default) or "CONSOLIDATED_BILLING". 150 FeatureSet pulumi.StringPtrInput 151 // ARN of the master account 152 MasterAccountArn pulumi.StringPtrInput 153 // Email address of the master account 154 MasterAccountEmail pulumi.StringPtrInput 155 // Identifier of the master account 156 MasterAccountId pulumi.StringPtrInput 157 // Name of the master account 158 MasterAccountName pulumi.StringPtrInput 159 // List of organization accounts excluding the master account. For a list including the master account, see the `accounts` attribute. All elements have these attributes: 160 NonMasterAccounts OrganizationNonMasterAccountArrayInput 161 // List of organization roots. All elements have these attributes: 162 Roots OrganizationRootArrayInput 163 } 164 165 func (OrganizationState) ElementType() reflect.Type { 166 return reflect.TypeOf((*organizationState)(nil)).Elem() 167 } 168 169 type organizationArgs struct { 170 // List of AWS service principal names for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. Organization must have `featureSet` set to `ALL`. Some services do not support enablement via this endpoint, see [warning in aws docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). 171 AwsServiceAccessPrincipals []string `pulumi:"awsServiceAccessPrincipals"` 172 // List of Organizations policy types to enable in the Organization Root. Organization must have `featureSet` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). 173 EnabledPolicyTypes []string `pulumi:"enabledPolicyTypes"` 174 // Specify "ALL" (default) or "CONSOLIDATED_BILLING". 175 FeatureSet *string `pulumi:"featureSet"` 176 } 177 178 // The set of arguments for constructing a Organization resource. 179 type OrganizationArgs struct { 180 // List of AWS service principal names for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. Organization must have `featureSet` set to `ALL`. Some services do not support enablement via this endpoint, see [warning in aws docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). 181 AwsServiceAccessPrincipals pulumi.StringArrayInput 182 // List of Organizations policy types to enable in the Organization Root. Organization must have `featureSet` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). 183 EnabledPolicyTypes pulumi.StringArrayInput 184 // Specify "ALL" (default) or "CONSOLIDATED_BILLING". 185 FeatureSet pulumi.StringPtrInput 186 } 187 188 func (OrganizationArgs) ElementType() reflect.Type { 189 return reflect.TypeOf((*organizationArgs)(nil)).Elem() 190 } 191 192 type OrganizationInput interface { 193 pulumi.Input 194 195 ToOrganizationOutput() OrganizationOutput 196 ToOrganizationOutputWithContext(ctx context.Context) OrganizationOutput 197 } 198 199 func (*Organization) ElementType() reflect.Type { 200 return reflect.TypeOf((**Organization)(nil)).Elem() 201 } 202 203 func (i *Organization) ToOrganizationOutput() OrganizationOutput { 204 return i.ToOrganizationOutputWithContext(context.Background()) 205 } 206 207 func (i *Organization) ToOrganizationOutputWithContext(ctx context.Context) OrganizationOutput { 208 return pulumi.ToOutputWithContext(ctx, i).(OrganizationOutput) 209 } 210 211 // OrganizationArrayInput is an input type that accepts OrganizationArray and OrganizationArrayOutput values. 212 // You can construct a concrete instance of `OrganizationArrayInput` via: 213 // 214 // OrganizationArray{ OrganizationArgs{...} } 215 type OrganizationArrayInput interface { 216 pulumi.Input 217 218 ToOrganizationArrayOutput() OrganizationArrayOutput 219 ToOrganizationArrayOutputWithContext(context.Context) OrganizationArrayOutput 220 } 221 222 type OrganizationArray []OrganizationInput 223 224 func (OrganizationArray) ElementType() reflect.Type { 225 return reflect.TypeOf((*[]*Organization)(nil)).Elem() 226 } 227 228 func (i OrganizationArray) ToOrganizationArrayOutput() OrganizationArrayOutput { 229 return i.ToOrganizationArrayOutputWithContext(context.Background()) 230 } 231 232 func (i OrganizationArray) ToOrganizationArrayOutputWithContext(ctx context.Context) OrganizationArrayOutput { 233 return pulumi.ToOutputWithContext(ctx, i).(OrganizationArrayOutput) 234 } 235 236 // OrganizationMapInput is an input type that accepts OrganizationMap and OrganizationMapOutput values. 237 // You can construct a concrete instance of `OrganizationMapInput` via: 238 // 239 // OrganizationMap{ "key": OrganizationArgs{...} } 240 type OrganizationMapInput interface { 241 pulumi.Input 242 243 ToOrganizationMapOutput() OrganizationMapOutput 244 ToOrganizationMapOutputWithContext(context.Context) OrganizationMapOutput 245 } 246 247 type OrganizationMap map[string]OrganizationInput 248 249 func (OrganizationMap) ElementType() reflect.Type { 250 return reflect.TypeOf((*map[string]*Organization)(nil)).Elem() 251 } 252 253 func (i OrganizationMap) ToOrganizationMapOutput() OrganizationMapOutput { 254 return i.ToOrganizationMapOutputWithContext(context.Background()) 255 } 256 257 func (i OrganizationMap) ToOrganizationMapOutputWithContext(ctx context.Context) OrganizationMapOutput { 258 return pulumi.ToOutputWithContext(ctx, i).(OrganizationMapOutput) 259 } 260 261 type OrganizationOutput struct{ *pulumi.OutputState } 262 263 func (OrganizationOutput) ElementType() reflect.Type { 264 return reflect.TypeOf((**Organization)(nil)).Elem() 265 } 266 267 func (o OrganizationOutput) ToOrganizationOutput() OrganizationOutput { 268 return o 269 } 270 271 func (o OrganizationOutput) ToOrganizationOutputWithContext(ctx context.Context) OrganizationOutput { 272 return o 273 } 274 275 // List of organization accounts including the master account. For a list excluding the master account, see the `nonMasterAccounts` attribute. All elements have these attributes: 276 func (o OrganizationOutput) Accounts() OrganizationAccountArrayOutput { 277 return o.ApplyT(func(v *Organization) OrganizationAccountArrayOutput { return v.Accounts }).(OrganizationAccountArrayOutput) 278 } 279 280 // ARN of the root 281 func (o OrganizationOutput) Arn() pulumi.StringOutput { 282 return o.ApplyT(func(v *Organization) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 283 } 284 285 // List of AWS service principal names for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. Organization must have `featureSet` set to `ALL`. Some services do not support enablement via this endpoint, see [warning in aws docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). 286 func (o OrganizationOutput) AwsServiceAccessPrincipals() pulumi.StringArrayOutput { 287 return o.ApplyT(func(v *Organization) pulumi.StringArrayOutput { return v.AwsServiceAccessPrincipals }).(pulumi.StringArrayOutput) 288 } 289 290 // List of Organizations policy types to enable in the Organization Root. Organization must have `featureSet` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). 291 func (o OrganizationOutput) EnabledPolicyTypes() pulumi.StringArrayOutput { 292 return o.ApplyT(func(v *Organization) pulumi.StringArrayOutput { return v.EnabledPolicyTypes }).(pulumi.StringArrayOutput) 293 } 294 295 // Specify "ALL" (default) or "CONSOLIDATED_BILLING". 296 func (o OrganizationOutput) FeatureSet() pulumi.StringPtrOutput { 297 return o.ApplyT(func(v *Organization) pulumi.StringPtrOutput { return v.FeatureSet }).(pulumi.StringPtrOutput) 298 } 299 300 // ARN of the master account 301 func (o OrganizationOutput) MasterAccountArn() pulumi.StringOutput { 302 return o.ApplyT(func(v *Organization) pulumi.StringOutput { return v.MasterAccountArn }).(pulumi.StringOutput) 303 } 304 305 // Email address of the master account 306 func (o OrganizationOutput) MasterAccountEmail() pulumi.StringOutput { 307 return o.ApplyT(func(v *Organization) pulumi.StringOutput { return v.MasterAccountEmail }).(pulumi.StringOutput) 308 } 309 310 // Identifier of the master account 311 func (o OrganizationOutput) MasterAccountId() pulumi.StringOutput { 312 return o.ApplyT(func(v *Organization) pulumi.StringOutput { return v.MasterAccountId }).(pulumi.StringOutput) 313 } 314 315 // Name of the master account 316 func (o OrganizationOutput) MasterAccountName() pulumi.StringOutput { 317 return o.ApplyT(func(v *Organization) pulumi.StringOutput { return v.MasterAccountName }).(pulumi.StringOutput) 318 } 319 320 // List of organization accounts excluding the master account. For a list including the master account, see the `accounts` attribute. All elements have these attributes: 321 func (o OrganizationOutput) NonMasterAccounts() OrganizationNonMasterAccountArrayOutput { 322 return o.ApplyT(func(v *Organization) OrganizationNonMasterAccountArrayOutput { return v.NonMasterAccounts }).(OrganizationNonMasterAccountArrayOutput) 323 } 324 325 // List of organization roots. All elements have these attributes: 326 func (o OrganizationOutput) Roots() OrganizationRootArrayOutput { 327 return o.ApplyT(func(v *Organization) OrganizationRootArrayOutput { return v.Roots }).(OrganizationRootArrayOutput) 328 } 329 330 type OrganizationArrayOutput struct{ *pulumi.OutputState } 331 332 func (OrganizationArrayOutput) ElementType() reflect.Type { 333 return reflect.TypeOf((*[]*Organization)(nil)).Elem() 334 } 335 336 func (o OrganizationArrayOutput) ToOrganizationArrayOutput() OrganizationArrayOutput { 337 return o 338 } 339 340 func (o OrganizationArrayOutput) ToOrganizationArrayOutputWithContext(ctx context.Context) OrganizationArrayOutput { 341 return o 342 } 343 344 func (o OrganizationArrayOutput) Index(i pulumi.IntInput) OrganizationOutput { 345 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Organization { 346 return vs[0].([]*Organization)[vs[1].(int)] 347 }).(OrganizationOutput) 348 } 349 350 type OrganizationMapOutput struct{ *pulumi.OutputState } 351 352 func (OrganizationMapOutput) ElementType() reflect.Type { 353 return reflect.TypeOf((*map[string]*Organization)(nil)).Elem() 354 } 355 356 func (o OrganizationMapOutput) ToOrganizationMapOutput() OrganizationMapOutput { 357 return o 358 } 359 360 func (o OrganizationMapOutput) ToOrganizationMapOutputWithContext(ctx context.Context) OrganizationMapOutput { 361 return o 362 } 363 364 func (o OrganizationMapOutput) MapIndex(k pulumi.StringInput) OrganizationOutput { 365 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Organization { 366 return vs[0].(map[string]*Organization)[vs[1].(string)] 367 }).(OrganizationOutput) 368 } 369 370 func init() { 371 pulumi.RegisterInputType(reflect.TypeOf((*OrganizationInput)(nil)).Elem(), &Organization{}) 372 pulumi.RegisterInputType(reflect.TypeOf((*OrganizationArrayInput)(nil)).Elem(), OrganizationArray{}) 373 pulumi.RegisterInputType(reflect.TypeOf((*OrganizationMapInput)(nil)).Elem(), OrganizationMap{}) 374 pulumi.RegisterOutputType(OrganizationOutput{}) 375 pulumi.RegisterOutputType(OrganizationArrayOutput{}) 376 pulumi.RegisterOutputType(OrganizationMapOutput{}) 377 }