All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.cloudformation.kotlin.StackInstancesArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.cloudformation.kotlin

import com.pulumi.aws.cloudformation.StackInstancesArgs.builder
import com.pulumi.aws.cloudformation.kotlin.inputs.StackInstancesDeploymentTargetsArgs
import com.pulumi.aws.cloudformation.kotlin.inputs.StackInstancesDeploymentTargetsArgsBuilder
import com.pulumi.aws.cloudformation.kotlin.inputs.StackInstancesOperationPreferencesArgs
import com.pulumi.aws.cloudformation.kotlin.inputs.StackInstancesOperationPreferencesArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * ### Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.cloudformation.StackInstances("example", {
 *     accounts: [
 *         "123456789012",
 *         "234567890123",
 *     ],
 *     regions: [
 *         "us-east-1",
 *         "us-west-2",
 *     ],
 *     stackSetName: exampleAwsCloudformationStackSet.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.cloudformation.StackInstances("example",
 *     accounts=[
 *         "123456789012",
 *         "234567890123",
 *     ],
 *     regions=[
 *         "us-east-1",
 *         "us-west-2",
 *     ],
 *     stack_set_name=example_aws_cloudformation_stack_set["name"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.CloudFormation.StackInstances("example", new()
 *     {
 *         Accounts = new[]
 *         {
 *             "123456789012",
 *             "234567890123",
 *         },
 *         Regions = new[]
 *         {
 *             "us-east-1",
 *             "us-west-2",
 *         },
 *         StackSetName = exampleAwsCloudformationStackSet.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudformation"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudformation.NewStackInstances(ctx, "example", &cloudformation.StackInstancesArgs{
 * 			Accounts: pulumi.StringArray{
 * 				pulumi.String("123456789012"),
 * 				pulumi.String("234567890123"),
 * 			},
 * 			Regions: pulumi.StringArray{
 * 				pulumi.String("us-east-1"),
 * 				pulumi.String("us-west-2"),
 * 			},
 * 			StackSetName: pulumi.Any(exampleAwsCloudformationStackSet.Name),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.cloudformation.StackInstances;
 * import com.pulumi.aws.cloudformation.StackInstancesArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new StackInstances("example", StackInstancesArgs.builder()
 *             .accounts(
 *                 "123456789012",
 *                 "234567890123")
 *             .regions(
 *                 "us-east-1",
 *                 "us-west-2")
 *             .stackSetName(exampleAwsCloudformationStackSet.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:cloudformation:StackInstances
 *     properties:
 *       accounts:
 *         - '123456789012'
 *         - '234567890123'
 *       regions:
 *         - us-east-1
 *         - us-west-2
 *       stackSetName: ${exampleAwsCloudformationStackSet.name}
 * ```
 * 
 * ### Example IAM Setup in Target Account
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy = aws.iam.getPolicyDocument({
 *     statements: [{
 *         actions: ["sts:AssumeRole"],
 *         effect: "Allow",
 *         principals: [{
 *             identifiers: [aWSCloudFormationStackSetAdministrationRole.arn],
 *             type: "AWS",
 *         }],
 *     }],
 * });
 * const aWSCloudFormationStackSetExecutionRole = new aws.iam.Role("AWSCloudFormationStackSetExecutionRole", {
 *     assumeRolePolicy: aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy.then(aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy => aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy.json),
 *     name: "AWSCloudFormationStackSetExecutionRole",
 * });
 * // Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html
 * // Additional IAM permissions necessary depend on the resources defined in the StackSet template
 * const aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy = aws.iam.getPolicyDocument({
 *     statements: [{
 *         actions: [
 *             "cloudformation:*",
 *             "s3:*",
 *             "sns:*",
 *         ],
 *         effect: "Allow",
 *         resources: ["*"],
 *     }],
 * });
 * const aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicyRolePolicy = new aws.iam.RolePolicy("AWSCloudFormationStackSetExecutionRole_MinimumExecutionPolicy", {
 *     name: "MinimumExecutionPolicy",
 *     policy: aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy.then(aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy => aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy.json),
 *     role: aWSCloudFormationStackSetExecutionRole.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * a_ws_cloud_formation_stack_set_execution_role_assume_role_policy = aws.iam.get_policy_document(statements=[{
 *     "actions": ["sts:AssumeRole"],
 *     "effect": "Allow",
 *     "principals": [{
 *         "identifiers": [a_ws_cloud_formation_stack_set_administration_role["arn"]],
 *         "type": "AWS",
 *     }],
 * }])
 * a_ws_cloud_formation_stack_set_execution_role = aws.iam.Role("AWSCloudFormationStackSetExecutionRole",
 *     assume_role_policy=a_ws_cloud_formation_stack_set_execution_role_assume_role_policy.json,
 *     name="AWSCloudFormationStackSetExecutionRole")
 * # Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html
 * # Additional IAM permissions necessary depend on the resources defined in the StackSet template
 * a_ws_cloud_formation_stack_set_execution_role_minimum_execution_policy = aws.iam.get_policy_document(statements=[{
 *     "actions": [
 *         "cloudformation:*",
 *         "s3:*",
 *         "sns:*",
 *     ],
 *     "effect": "Allow",
 *     "resources": ["*"],
 * }])
 * a_ws_cloud_formation_stack_set_execution_role_minimum_execution_policy_role_policy = aws.iam.RolePolicy("AWSCloudFormationStackSetExecutionRole_MinimumExecutionPolicy",
 *     name="MinimumExecutionPolicy",
 *     policy=a_ws_cloud_formation_stack_set_execution_role_minimum_execution_policy.json,
 *     role=a_ws_cloud_formation_stack_set_execution_role.name)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy = Aws.Iam.GetPolicyDocument.Invoke(new()
 *     {
 *         Statements = new[]
 *         {
 *             new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
 *             {
 *                 Actions = new[]
 *                 {
 *                     "sts:AssumeRole",
 *                 },
 *                 Effect = "Allow",
 *                 Principals = new[]
 *                 {
 *                     new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
 *                     {
 *                         Identifiers = new[]
 *                         {
 *                             aWSCloudFormationStackSetAdministrationRole.Arn,
 *                         },
 *                         Type = "AWS",
 *                     },
 *                 },
 *             },
 *         },
 *     });
 *     var aWSCloudFormationStackSetExecutionRole = new Aws.Iam.Role("AWSCloudFormationStackSetExecutionRole", new()
 *     {
 *         AssumeRolePolicy = aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
 *         Name = "AWSCloudFormationStackSetExecutionRole",
 *     });
 *     // Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html
 *     // Additional IAM permissions necessary depend on the resources defined in the StackSet template
 *     var aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy = Aws.Iam.GetPolicyDocument.Invoke(new()
 *     {
 *         Statements = new[]
 *         {
 *             new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
 *             {
 *                 Actions = new[]
 *                 {
 *                     "cloudformation:*",
 *                     "s3:*",
 *                     "sns:*",
 *                 },
 *                 Effect = "Allow",
 *                 Resources = new[]
 *                 {
 *                     "*",
 *                 },
 *             },
 *         },
 *     });
 *     var aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicyRolePolicy = new Aws.Iam.RolePolicy("AWSCloudFormationStackSetExecutionRole_MinimumExecutionPolicy", new()
 *     {
 *         Name = "MinimumExecutionPolicy",
 *         Policy = aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
 *         Role = aWSCloudFormationStackSetExecutionRole.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * pulumi.Run(func(ctx *pulumi.Context) error {
 * aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
 * Statements: []iam.GetPolicyDocumentStatement{
 * {
 * Actions: []string{
 * "sts:AssumeRole",
 * },
 * Effect: pulumi.StringRef("Allow"),
 * Principals: []iam.GetPolicyDocumentStatementPrincipal{
 * {
 * Identifiers: interface{}{
 * aWSCloudFormationStackSetAdministrationRole.Arn,
 * },
 * Type: "AWS",
 * },
 * },
 * },
 * },
 * }, nil);
 * if err != nil {
 * return err
 * }
 * aWSCloudFormationStackSetExecutionRole, err := iam.NewRole(ctx, "AWSCloudFormationStackSetExecutionRole", &iam.RoleArgs{
 * AssumeRolePolicy: pulumi.String(aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy.Json),
 * Name: pulumi.String("AWSCloudFormationStackSetExecutionRole"),
 * })
 * if err != nil {
 * return err
 * }
 * // Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html
 * // Additional IAM permissions necessary depend on the resources defined in the StackSet template
 * aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
 * Statements: []iam.GetPolicyDocumentStatement{
 * {
 * Actions: []string{
 * "cloudformation:*",
 * "s3:*",
 * "sns:*",
 * },
 * Effect: pulumi.StringRef("Allow"),
 * Resources: []string{
 * "*",
 * },
 * },
 * },
 * }, nil);
 * if err != nil {
 * return err
 * }
 * _, err = iam.NewRolePolicy(ctx, "AWSCloudFormationStackSetExecutionRole_MinimumExecutionPolicy", &iam.RolePolicyArgs{
 * Name: pulumi.String("MinimumExecutionPolicy"),
 * Policy: pulumi.String(aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy.Json),
 * Role: aWSCloudFormationStackSetExecutionRole.Name,
 * })
 * if err != nil {
 * return err
 * }
 * return nil
 * })
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.iam.IamFunctions;
 * import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
 * import com.pulumi.aws.iam.Role;
 * import com.pulumi.aws.iam.RoleArgs;
 * import com.pulumi.aws.iam.RolePolicy;
 * import com.pulumi.aws.iam.RolePolicyArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         final var aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
 *             .statements(GetPolicyDocumentStatementArgs.builder()
 *                 .actions("sts:AssumeRole")
 *                 .effect("Allow")
 *                 .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
 *                     .identifiers(aWSCloudFormationStackSetAdministrationRole.arn())
 *                     .type("AWS")
 *                     .build())
 *                 .build())
 *             .build());
 *         var aWSCloudFormationStackSetExecutionRole = new Role("aWSCloudFormationStackSetExecutionRole", RoleArgs.builder()
 *             .assumeRolePolicy(aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
 *             .name("AWSCloudFormationStackSetExecutionRole")
 *             .build());
 *         // Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html
 *         // Additional IAM permissions necessary depend on the resources defined in the StackSet template
 *         final var aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
 *             .statements(GetPolicyDocumentStatementArgs.builder()
 *                 .actions(
 *                     "cloudformation:*",
 *                     "s3:*",
 *                     "sns:*")
 *                 .effect("Allow")
 *                 .resources("*")
 *                 .build())
 *             .build());
 *         var aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicyRolePolicy = new RolePolicy("aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicyRolePolicy", RolePolicyArgs.builder()
 *             .name("MinimumExecutionPolicy")
 *             .policy(aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json()))
 *             .role(aWSCloudFormationStackSetExecutionRole.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   aWSCloudFormationStackSetExecutionRole:
 *     type: aws:iam:Role
 *     name: AWSCloudFormationStackSetExecutionRole
 *     properties:
 *       assumeRolePolicy: ${aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy.json}
 *       name: AWSCloudFormationStackSetExecutionRole
 *   aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicyRolePolicy:
 *     type: aws:iam:RolePolicy
 *     name: AWSCloudFormationStackSetExecutionRole_MinimumExecutionPolicy
 *     properties:
 *       name: MinimumExecutionPolicy
 *       policy: ${aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy.json}
 *       role: ${aWSCloudFormationStackSetExecutionRole.name}
 * variables:
 *   aWSCloudFormationStackSetExecutionRoleAssumeRolePolicy:
 *     fn::invoke:
 *       Function: aws:iam:getPolicyDocument
 *       Arguments:
 *         statements:
 *           - actions:
 *               - sts:AssumeRole
 *             effect: Allow
 *             principals:
 *               - identifiers:
 *                   - ${aWSCloudFormationStackSetAdministrationRole.arn}
 *                 type: AWS
 *   # Documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs.html
 *   # Additional IAM permissions necessary depend on the resources defined in the StackSet template
 *   aWSCloudFormationStackSetExecutionRoleMinimumExecutionPolicy:
 *     fn::invoke:
 *       Function: aws:iam:getPolicyDocument
 *       Arguments:
 *         statements:
 *           - actions:
 *               - cloudformation:*
 *               - s3:*
 *               - sns:*
 *             effect: Allow
 *             resources:
 *               - '*'
 * ```
 * 
 * ### Example Deployment across Organizations account
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.cloudformation.StackInstances("example", {
 *     deploymentTargets: {
 *         organizationalUnitIds: [exampleAwsOrganizationsOrganization.roots[0].id],
 *     },
 *     regions: [
 *         "us-west-2",
 *         "us-east-1",
 *     ],
 *     stackSetName: exampleAwsCloudformationStackSet.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.cloudformation.StackInstances("example",
 *     deployment_targets={
 *         "organizational_unit_ids": [example_aws_organizations_organization["roots"][0]["id"]],
 *     },
 *     regions=[
 *         "us-west-2",
 *         "us-east-1",
 *     ],
 *     stack_set_name=example_aws_cloudformation_stack_set["name"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.CloudFormation.StackInstances("example", new()
 *     {
 *         DeploymentTargets = new Aws.CloudFormation.Inputs.StackInstancesDeploymentTargetsArgs
 *         {
 *             OrganizationalUnitIds = new[]
 *             {
 *                 exampleAwsOrganizationsOrganization.Roots[0].Id,
 *             },
 *         },
 *         Regions = new[]
 *         {
 *             "us-west-2",
 *             "us-east-1",
 *         },
 *         StackSetName = exampleAwsCloudformationStackSet.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudformation"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudformation.NewStackInstances(ctx, "example", &cloudformation.StackInstancesArgs{
 * 			DeploymentTargets: &cloudformation.StackInstancesDeploymentTargetsArgs{
 * 				OrganizationalUnitIds: pulumi.StringArray{
 * 					exampleAwsOrganizationsOrganization.Roots[0].Id,
 * 				},
 * 			},
 * 			Regions: pulumi.StringArray{
 * 				pulumi.String("us-west-2"),
 * 				pulumi.String("us-east-1"),
 * 			},
 * 			StackSetName: pulumi.Any(exampleAwsCloudformationStackSet.Name),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.cloudformation.StackInstances;
 * import com.pulumi.aws.cloudformation.StackInstancesArgs;
 * import com.pulumi.aws.cloudformation.inputs.StackInstancesDeploymentTargetsArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new StackInstances("example", StackInstancesArgs.builder()
 *             .deploymentTargets(StackInstancesDeploymentTargetsArgs.builder()
 *                 .organizationalUnitIds(exampleAwsOrganizationsOrganization.roots()[0].id())
 *                 .build())
 *             .regions(
 *                 "us-west-2",
 *                 "us-east-1")
 *             .stackSetName(exampleAwsCloudformationStackSet.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:cloudformation:StackInstances
 *     properties:
 *       deploymentTargets:
 *         organizationalUnitIds:
 *           - ${exampleAwsOrganizationsOrganization.roots[0].id}
 *       regions:
 *         - us-west-2
 *         - us-east-1
 *       stackSetName: ${exampleAwsCloudformationStackSet.name}
 * ```
 * 
 * ## Import
 * Import CloudFormation stack instances that target OUs, using the stack set name, `call_as`, and "OU" separated by commas (`,`). For example:
 * Using `pulumi import`, import CloudFormation stack instances using the stack set name and `call_as` separated by commas (`,`). If you are importing a stack instance targeting OUs, see the example below. For example:
 * ```sh
 * $ pulumi import aws:cloudformation/stackInstances:StackInstances example example,SELF
 * ```
 * Using `pulumi import`, Import CloudFormation stack instances that target OUs, using the stack set name, `call_as`, and "OU" separated by commas (`,`). For example:
 * ```sh
 * $ pulumi import aws:cloudformation/stackInstances:StackInstances example example,SELF,OU
 * ```
 * @property accounts Accounts where you want to create stack instances in the specified `regions`. You can specify either `accounts` or `deployment_targets`, but not both.
 * @property callAs Whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account. Valid values: `SELF` (default), `DELEGATED_ADMIN`.
 * @property deploymentTargets AWS Organizations accounts for which to create stack instances in the `regions`. stack sets doesn't deploy stack instances to the organization management account, even if the organization management account is in your organization or in an OU in your organization. Drift detection is not possible for most of this argument. See deployment_targets below.
 * @property operationPreferences Preferences for how AWS CloudFormation performs a stack set operation. See operation_preferences below.
 * @property parameterOverrides Key-value map of input parameters to override from the stack set for these instances. This argument's drift detection is limited to the first account and region since each instance can have unique parameters.
 * @property regions Regions where you want to create stack instances in the specified `accounts`.
 * @property retainStacks Whether to remove the stack instances from the stack set, but not delete the stacks. You can't reassociate a retained stack or add an existing, saved stack to a new stack set. To retain the stack, ensure `retain_stacks = true` has been successfully applied _before_ an apply that would destroy the resource. Defaults to `false`.
 * @property stackSetName Name of the stack set.
 * The following arguments are optional:
 */
public data class StackInstancesArgs(
    public val accounts: Output>? = null,
    public val callAs: Output? = null,
    public val deploymentTargets: Output? = null,
    public val operationPreferences: Output? = null,
    public val parameterOverrides: Output>? = null,
    public val regions: Output>? = null,
    public val retainStacks: Output? = null,
    public val stackSetName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.cloudformation.StackInstancesArgs =
        com.pulumi.aws.cloudformation.StackInstancesArgs.builder()
            .accounts(accounts?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .callAs(callAs?.applyValue({ args0 -> args0 }))
            .deploymentTargets(deploymentTargets?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .operationPreferences(
                operationPreferences?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .parameterOverrides(
                parameterOverrides?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .regions(regions?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .retainStacks(retainStacks?.applyValue({ args0 -> args0 }))
            .stackSetName(stackSetName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [StackInstancesArgs].
 */
@PulumiTagMarker
public class StackInstancesArgsBuilder internal constructor() {
    private var accounts: Output>? = null

    private var callAs: Output? = null

    private var deploymentTargets: Output? = null

    private var operationPreferences: Output? = null

    private var parameterOverrides: Output>? = null

    private var regions: Output>? = null

    private var retainStacks: Output? = null

    private var stackSetName: Output? = null

    /**
     * @param value Accounts where you want to create stack instances in the specified `regions`. You can specify either `accounts` or `deployment_targets`, but not both.
     */
    @JvmName("jdbewfuecjwyuqdf")
    public suspend fun accounts(`value`: Output>) {
        this.accounts = value
    }

    @JvmName("lusmskdjyqjjwxeq")
    public suspend fun accounts(vararg values: Output) {
        this.accounts = Output.all(values.asList())
    }

    /**
     * @param values Accounts where you want to create stack instances in the specified `regions`. You can specify either `accounts` or `deployment_targets`, but not both.
     */
    @JvmName("rcmbqhkbaxogatan")
    public suspend fun accounts(values: List>) {
        this.accounts = Output.all(values)
    }

    /**
     * @param value Whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account. Valid values: `SELF` (default), `DELEGATED_ADMIN`.
     */
    @JvmName("myxellbcnmkqpwqm")
    public suspend fun callAs(`value`: Output) {
        this.callAs = value
    }

    /**
     * @param value AWS Organizations accounts for which to create stack instances in the `regions`. stack sets doesn't deploy stack instances to the organization management account, even if the organization management account is in your organization or in an OU in your organization. Drift detection is not possible for most of this argument. See deployment_targets below.
     */
    @JvmName("xkbffkhedlfrephs")
    public suspend fun deploymentTargets(`value`: Output) {
        this.deploymentTargets = value
    }

    /**
     * @param value Preferences for how AWS CloudFormation performs a stack set operation. See operation_preferences below.
     */
    @JvmName("hxeaivrxsigicyqc")
    public suspend fun operationPreferences(`value`: Output) {
        this.operationPreferences = value
    }

    /**
     * @param value Key-value map of input parameters to override from the stack set for these instances. This argument's drift detection is limited to the first account and region since each instance can have unique parameters.
     */
    @JvmName("hhyauonwwygsxeda")
    public suspend fun parameterOverrides(`value`: Output>) {
        this.parameterOverrides = value
    }

    /**
     * @param value Regions where you want to create stack instances in the specified `accounts`.
     */
    @JvmName("osswuqprfmdpkyko")
    public suspend fun regions(`value`: Output>) {
        this.regions = value
    }

    @JvmName("egrmkauuheeithlv")
    public suspend fun regions(vararg values: Output) {
        this.regions = Output.all(values.asList())
    }

    /**
     * @param values Regions where you want to create stack instances in the specified `accounts`.
     */
    @JvmName("bujqwwolamuurrrv")
    public suspend fun regions(values: List>) {
        this.regions = Output.all(values)
    }

    /**
     * @param value Whether to remove the stack instances from the stack set, but not delete the stacks. You can't reassociate a retained stack or add an existing, saved stack to a new stack set. To retain the stack, ensure `retain_stacks = true` has been successfully applied _before_ an apply that would destroy the resource. Defaults to `false`.
     */
    @JvmName("yithvrjollexgjsx")
    public suspend fun retainStacks(`value`: Output) {
        this.retainStacks = value
    }

    /**
     * @param value Name of the stack set.
     * The following arguments are optional:
     */
    @JvmName("frhbvrbgajmriwqa")
    public suspend fun stackSetName(`value`: Output) {
        this.stackSetName = value
    }

    /**
     * @param value Accounts where you want to create stack instances in the specified `regions`. You can specify either `accounts` or `deployment_targets`, but not both.
     */
    @JvmName("cbrlsvvqwwkskfas")
    public suspend fun accounts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accounts = mapped
    }

    /**
     * @param values Accounts where you want to create stack instances in the specified `regions`. You can specify either `accounts` or `deployment_targets`, but not both.
     */
    @JvmName("wtogcnddbplmetmc")
    public suspend fun accounts(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.accounts = mapped
    }

    /**
     * @param value Whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account. Valid values: `SELF` (default), `DELEGATED_ADMIN`.
     */
    @JvmName("nwxkahadjdewnafd")
    public suspend fun callAs(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.callAs = mapped
    }

    /**
     * @param value AWS Organizations accounts for which to create stack instances in the `regions`. stack sets doesn't deploy stack instances to the organization management account, even if the organization management account is in your organization or in an OU in your organization. Drift detection is not possible for most of this argument. See deployment_targets below.
     */
    @JvmName("ugtivbnlmvsxldyu")
    public suspend fun deploymentTargets(`value`: StackInstancesDeploymentTargetsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.deploymentTargets = mapped
    }

    /**
     * @param argument AWS Organizations accounts for which to create stack instances in the `regions`. stack sets doesn't deploy stack instances to the organization management account, even if the organization management account is in your organization or in an OU in your organization. Drift detection is not possible for most of this argument. See deployment_targets below.
     */
    @JvmName("nogpojaalnmmpgoo")
    public suspend fun deploymentTargets(argument: suspend StackInstancesDeploymentTargetsArgsBuilder.() -> Unit) {
        val toBeMapped = StackInstancesDeploymentTargetsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.deploymentTargets = mapped
    }

    /**
     * @param value Preferences for how AWS CloudFormation performs a stack set operation. See operation_preferences below.
     */
    @JvmName("ybynxtsnmrwhlojd")
    public suspend fun operationPreferences(`value`: StackInstancesOperationPreferencesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.operationPreferences = mapped
    }

    /**
     * @param argument Preferences for how AWS CloudFormation performs a stack set operation. See operation_preferences below.
     */
    @JvmName("jqdwsuoluwyhijtk")
    public suspend fun operationPreferences(argument: suspend StackInstancesOperationPreferencesArgsBuilder.() -> Unit) {
        val toBeMapped = StackInstancesOperationPreferencesArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.operationPreferences = mapped
    }

    /**
     * @param value Key-value map of input parameters to override from the stack set for these instances. This argument's drift detection is limited to the first account and region since each instance can have unique parameters.
     */
    @JvmName("icllcawgvyqjlinx")
    public suspend fun parameterOverrides(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameterOverrides = mapped
    }

    /**
     * @param values Key-value map of input parameters to override from the stack set for these instances. This argument's drift detection is limited to the first account and region since each instance can have unique parameters.
     */
    @JvmName("yawstkoyilbetlki")
    public fun parameterOverrides(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.parameterOverrides = mapped
    }

    /**
     * @param value Regions where you want to create stack instances in the specified `accounts`.
     */
    @JvmName("xsbepgapytlasuop")
    public suspend fun regions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.regions = mapped
    }

    /**
     * @param values Regions where you want to create stack instances in the specified `accounts`.
     */
    @JvmName("dmjvfofburiimbbh")
    public suspend fun regions(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.regions = mapped
    }

    /**
     * @param value Whether to remove the stack instances from the stack set, but not delete the stacks. You can't reassociate a retained stack or add an existing, saved stack to a new stack set. To retain the stack, ensure `retain_stacks = true` has been successfully applied _before_ an apply that would destroy the resource. Defaults to `false`.
     */
    @JvmName("mswdmpfyocofcwep")
    public suspend fun retainStacks(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retainStacks = mapped
    }

    /**
     * @param value Name of the stack set.
     * The following arguments are optional:
     */
    @JvmName("dtwtcxeaxstpkhaj")
    public suspend fun stackSetName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stackSetName = mapped
    }

    internal fun build(): StackInstancesArgs = StackInstancesArgs(
        accounts = accounts,
        callAs = callAs,
        deploymentTargets = deploymentTargets,
        operationPreferences = operationPreferences,
        parameterOverrides = parameterOverrides,
        regions = regions,
        retainStacks = retainStacks,
        stackSetName = stackSetName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy