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

com.pulumi.aws.iam.kotlin.OrganizationsFeatures.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.iam.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [OrganizationsFeatures].
 */
@PulumiTagMarker
public class OrganizationsFeaturesResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: OrganizationsFeaturesArgs = OrganizationsFeaturesArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend OrganizationsFeaturesArgsBuilder.() -> Unit) {
        val builder = OrganizationsFeaturesArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): OrganizationsFeatures {
        val builtJavaResource = com.pulumi.aws.iam.OrganizationsFeatures(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return OrganizationsFeatures(builtJavaResource)
    }
}

/**
 * Manages centralized root access features across AWS member accounts managed using AWS Organizations. More information about managing root access in IAM can be found in the [Centralize root access for member accounts](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-enable-root-access.html).
 * > **NOTE:** The AWS account utilizing this resource must be an Organizations management account. Also, you must enable trusted access for AWS Identity and Access Management in AWS Organizations.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.organizations.Organization("example", {
 *     awsServiceAccessPrincipals: ["iam.amazonaws.com"],
 *     featureSet: "ALL",
 * });
 * const exampleOrganizationsFeatures = new aws.iam.OrganizationsFeatures("example", {enabledFeatures: [
 *     "RootCredentialsManagement",
 *     "RootSessions",
 * ]});
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.organizations.Organization("example",
 *     aws_service_access_principals=["iam.amazonaws.com"],
 *     feature_set="ALL")
 * example_organizations_features = aws.iam.OrganizationsFeatures("example", enabled_features=[
 *     "RootCredentialsManagement",
 *     "RootSessions",
 * ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Organizations.Organization("example", new()
 *     {
 *         AwsServiceAccessPrincipals = new[]
 *         {
 *             "iam.amazonaws.com",
 *         },
 *         FeatureSet = "ALL",
 *     });
 *     var exampleOrganizationsFeatures = new Aws.Iam.OrganizationsFeatures("example", new()
 *     {
 *         EnabledFeatures = new[]
 *         {
 *             "RootCredentialsManagement",
 *             "RootSessions",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/organizations"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := organizations.NewOrganization(ctx, "example", &organizations.OrganizationArgs{
 * 			AwsServiceAccessPrincipals: pulumi.StringArray{
 * 				pulumi.String("iam.amazonaws.com"),
 * 			},
 * 			FeatureSet: pulumi.String("ALL"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = iam.NewOrganizationsFeatures(ctx, "example", &iam.OrganizationsFeaturesArgs{
 * 			EnabledFeatures: pulumi.StringArray{
 * 				pulumi.String("RootCredentialsManagement"),
 * 				pulumi.String("RootSessions"),
 * 			},
 * 		})
 * 		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.organizations.Organization;
 * import com.pulumi.aws.organizations.OrganizationArgs;
 * import com.pulumi.aws.iam.OrganizationsFeatures;
 * import com.pulumi.aws.iam.OrganizationsFeaturesArgs;
 * 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 Organization("example", OrganizationArgs.builder()
 *             .awsServiceAccessPrincipals("iam.amazonaws.com")
 *             .featureSet("ALL")
 *             .build());
 *         var exampleOrganizationsFeatures = new OrganizationsFeatures("exampleOrganizationsFeatures", OrganizationsFeaturesArgs.builder()
 *             .enabledFeatures(
 *                 "RootCredentialsManagement",
 *                 "RootSessions")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:organizations:Organization
 *     properties:
 *       awsServiceAccessPrincipals:
 *         - iam.amazonaws.com
 *       featureSet: ALL
 *   exampleOrganizationsFeatures:
 *     type: aws:iam:OrganizationsFeatures
 *     name: example
 *     properties:
 *       enabledFeatures:
 *         - RootCredentialsManagement
 *         - RootSessions
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import root access features using the `id`. For example:
 * ```sh
 * $ pulumi import aws:iam/organizationsFeatures:OrganizationsFeatures example o-1234567
 * ```
 */
public class OrganizationsFeatures internal constructor(
    override val javaResource: com.pulumi.aws.iam.OrganizationsFeatures,
) : KotlinCustomResource(javaResource, OrganizationsFeaturesMapper) {
    /**
     * List of IAM features to enable. Valid values are `RootCredentialsManagement` and `RootSessions`.
     */
    public val enabledFeatures: Output>
        get() = javaResource.enabledFeatures().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}

public object OrganizationsFeaturesMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.iam.OrganizationsFeatures::class == javaResource::class

    override fun map(javaResource: Resource): OrganizationsFeatures =
        OrganizationsFeatures(javaResource as com.pulumi.aws.iam.OrganizationsFeatures)
}

/**
 * @see [OrganizationsFeatures].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [OrganizationsFeatures].
 */
public suspend fun organizationsFeatures(
    name: String,
    block: suspend OrganizationsFeaturesResourceBuilder.() -> Unit,
): OrganizationsFeatures {
    val builder = OrganizationsFeaturesResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [OrganizationsFeatures].
 * @param name The _unique_ name of the resulting resource.
 */
public fun organizationsFeatures(name: String): OrganizationsFeatures {
    val builder = OrganizationsFeaturesResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy