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

io.cloudshiftdev.awscdk.services.iam.CfnSAMLProvider.kt Maven / Gradle / Ivy

The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")

package io.cloudshiftdev.awscdk.services.iam

import io.cloudshiftdev.awscdk.CfnResource
import io.cloudshiftdev.awscdk.CfnTag
import io.cloudshiftdev.awscdk.IInspectable
import io.cloudshiftdev.awscdk.ITaggable
import io.cloudshiftdev.awscdk.TagManager
import io.cloudshiftdev.awscdk.TreeInspector
import io.cloudshiftdev.awscdk.common.CdkDslMarker
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import io.cloudshiftdev.constructs.Construct as CloudshiftdevConstructsConstruct
import software.constructs.Construct as SoftwareConstructsConstruct

/**
 * Creates an IAM resource that describes an identity provider (IdP) that supports SAML 2.0.
 *
 * The SAML provider resource that you create with this operation can be used as a principal in an
 * IAM role's trust policy. Such a policy can enable federated users who sign in using the SAML IdP to
 * assume the role. You can create an IAM role that supports Web-based single sign-on (SSO) to the AWS
 * Management Console or one that supports API access to AWS .
 *
 * When you create the SAML provider resource, you upload a SAML metadata document that you get from
 * your IdP. That document includes the issuer's name, expiration information, and keys that can be
 * used to validate the SAML authentication response (assertions) that the IdP sends. You must generate
 * the metadata document using the identity management software that is used as your organization's
 * IdP.
 *
 *
 * This operation requires [Signature Version
 * 4](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) .
 *
 *
 * For more information, see [Enabling SAML 2.0 federated users to access the AWS Management
 * Console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html)
 * and [About SAML 2.0-based
 * federation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) in the
 * *IAM User Guide* .
 *
 * Example:
 *
 * ```
 * // The code below shows an example of how to instantiate this type.
 * // The values are placeholders you should change.
 * import io.cloudshiftdev.awscdk.services.iam.*;
 * CfnSAMLProvider cfnSAMLProvider = CfnSAMLProvider.Builder.create(this, "MyCfnSAMLProvider")
 * .samlMetadataDocument("samlMetadataDocument")
 * // the properties below are optional
 * .name("name")
 * .tags(List.of(CfnTag.builder()
 * .key("key")
 * .value("value")
 * .build()))
 * .build();
 * ```
 *
 * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html)
 */
public open class CfnSAMLProvider(
  cdkObject: software.amazon.awscdk.services.iam.CfnSAMLProvider,
) : CfnResource(cdkObject),
    IInspectable,
    ITaggable {
  public constructor(
    scope: CloudshiftdevConstructsConstruct,
    id: String,
    props: CfnSAMLProviderProps,
  ) :
      this(software.amazon.awscdk.services.iam.CfnSAMLProvider(scope.let(CloudshiftdevConstructsConstruct.Companion::unwrap),
      id, props.let(CfnSAMLProviderProps.Companion::unwrap))
  )

  public constructor(
    scope: CloudshiftdevConstructsConstruct,
    id: String,
    props: CfnSAMLProviderProps.Builder.() -> Unit,
  ) : this(scope, id, CfnSAMLProviderProps(props)
  )

  /**
   * Returns the Amazon Resource Name (ARN) for the specified `AWS::IAM::SAMLProvider` resource.
   */
  public open fun attrArn(): String = unwrap(this).getAttrArn()

  /**
   * Examines the CloudFormation resource and discloses attributes.
   *
   * @param inspector tree inspector to collect and process attributes. 
   */
  public override fun inspect(inspector: TreeInspector) {
    unwrap(this).inspect(inspector.let(TreeInspector.Companion::unwrap))
  }

  /**
   * The name of the provider to create.
   */
  public open fun name(): String? = unwrap(this).getName()

  /**
   * The name of the provider to create.
   */
  public open fun name(`value`: String) {
    unwrap(this).setName(`value`)
  }

  /**
   * An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document
   * includes the issuer's name, expiration information, and keys that can be used to validate the SAML
   * authentication response (assertions) that are received from the IdP. You must generate the
   * metadata document using the identity management software that is used as your organization's IdP.
   */
  public open fun samlMetadataDocument(): String = unwrap(this).getSamlMetadataDocument()

  /**
   * An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document
   * includes the issuer's name, expiration information, and keys that can be used to validate the SAML
   * authentication response (assertions) that are received from the IdP. You must generate the
   * metadata document using the identity management software that is used as your organization's IdP.
   */
  public open fun samlMetadataDocument(`value`: String) {
    unwrap(this).setSamlMetadataDocument(`value`)
  }

  /**
   * Tag Manager which manages the tags for this resource.
   */
  public override fun tags(): TagManager = unwrap(this).getTags().let(TagManager::wrap)

  /**
   * A list of tags that you want to attach to the new IAM SAML provider.
   */
  public open fun tagsRaw(): List = unwrap(this).getTagsRaw()?.map(CfnTag::wrap) ?:
      emptyList()

  /**
   * A list of tags that you want to attach to the new IAM SAML provider.
   */
  public open fun tagsRaw(`value`: List) {
    unwrap(this).setTagsRaw(`value`.map(CfnTag.Companion::unwrap))
  }

  /**
   * A list of tags that you want to attach to the new IAM SAML provider.
   */
  public open fun tagsRaw(vararg `value`: CfnTag): Unit = tagsRaw(`value`.toList())

  /**
   * A fluent builder for [io.cloudshiftdev.awscdk.services.iam.CfnSAMLProvider].
   */
  @CdkDslMarker
  public interface Builder {
    /**
     * The name of the provider to create.
     *
     * This parameter allows (through its [regex
     * pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) ) a string of characters
     * consisting of upper and lowercase alphanumeric characters with no spaces. You can also include
     * any of the following characters: _+=,.@-
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-name)
     * @param name The name of the provider to create. 
     */
    public fun name(name: String)

    /**
     * An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document
     * includes the issuer's name, expiration information, and keys that can be used to validate the
     * SAML authentication response (assertions) that are received from the IdP. You must generate the
     * metadata document using the identity management software that is used as your organization's
     * IdP.
     *
     * For more information, see [About SAML 2.0-based
     * federation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) in
     * the *IAM User Guide*
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-samlmetadatadocument)
     * @param samlMetadataDocument An XML document generated by an identity provider (IdP) that
     * supports SAML 2.0. The document includes the issuer's name, expiration information, and keys
     * that can be used to validate the SAML authentication response (assertions) that are received
     * from the IdP. You must generate the metadata document using the identity management software
     * that is used as your organization's IdP. 
     */
    public fun samlMetadataDocument(samlMetadataDocument: String)

    /**
     * A list of tags that you want to attach to the new IAM SAML provider.
     *
     * Each tag consists of a key name and an associated value. For more information about tagging,
     * see [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in
     * the *IAM User Guide* .
     *
     *
     * If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then
     * the entire request fails and the resource is not created.
     *
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-tags)
     * @param tags A list of tags that you want to attach to the new IAM SAML provider. 
     */
    public fun tags(tags: List)

    /**
     * A list of tags that you want to attach to the new IAM SAML provider.
     *
     * Each tag consists of a key name and an associated value. For more information about tagging,
     * see [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in
     * the *IAM User Guide* .
     *
     *
     * If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then
     * the entire request fails and the resource is not created.
     *
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-tags)
     * @param tags A list of tags that you want to attach to the new IAM SAML provider. 
     */
    public fun tags(vararg tags: CfnTag)
  }

  private class BuilderImpl(
    scope: SoftwareConstructsConstruct,
    id: String,
  ) : Builder {
    private val cdkBuilder: software.amazon.awscdk.services.iam.CfnSAMLProvider.Builder =
        software.amazon.awscdk.services.iam.CfnSAMLProvider.Builder.create(scope, id)

    /**
     * The name of the provider to create.
     *
     * This parameter allows (through its [regex
     * pattern](https://docs.aws.amazon.com/http://wikipedia.org/wiki/regex) ) a string of characters
     * consisting of upper and lowercase alphanumeric characters with no spaces. You can also include
     * any of the following characters: _+=,.@-
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-name)
     * @param name The name of the provider to create. 
     */
    override fun name(name: String) {
      cdkBuilder.name(name)
    }

    /**
     * An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document
     * includes the issuer's name, expiration information, and keys that can be used to validate the
     * SAML authentication response (assertions) that are received from the IdP. You must generate the
     * metadata document using the identity management software that is used as your organization's
     * IdP.
     *
     * For more information, see [About SAML 2.0-based
     * federation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html) in
     * the *IAM User Guide*
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-samlmetadatadocument)
     * @param samlMetadataDocument An XML document generated by an identity provider (IdP) that
     * supports SAML 2.0. The document includes the issuer's name, expiration information, and keys
     * that can be used to validate the SAML authentication response (assertions) that are received
     * from the IdP. You must generate the metadata document using the identity management software
     * that is used as your organization's IdP. 
     */
    override fun samlMetadataDocument(samlMetadataDocument: String) {
      cdkBuilder.samlMetadataDocument(samlMetadataDocument)
    }

    /**
     * A list of tags that you want to attach to the new IAM SAML provider.
     *
     * Each tag consists of a key name and an associated value. For more information about tagging,
     * see [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in
     * the *IAM User Guide* .
     *
     *
     * If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then
     * the entire request fails and the resource is not created.
     *
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-tags)
     * @param tags A list of tags that you want to attach to the new IAM SAML provider. 
     */
    override fun tags(tags: List) {
      cdkBuilder.tags(tags.map(CfnTag.Companion::unwrap))
    }

    /**
     * A list of tags that you want to attach to the new IAM SAML provider.
     *
     * Each tag consists of a key name and an associated value. For more information about tagging,
     * see [Tagging IAM resources](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html) in
     * the *IAM User Guide* .
     *
     *
     * If any one of the tags is invalid or if you exceed the allowed maximum number of tags, then
     * the entire request fails and the resource is not created.
     *
     *
     * [Documentation](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-samlprovider.html#cfn-iam-samlprovider-tags)
     * @param tags A list of tags that you want to attach to the new IAM SAML provider. 
     */
    override fun tags(vararg tags: CfnTag): Unit = tags(tags.toList())

    public fun build(): software.amazon.awscdk.services.iam.CfnSAMLProvider = cdkBuilder.build()
  }

  public companion object {
    public val CFN_RESOURCE_TYPE_NAME: String =
        software.amazon.awscdk.services.iam.CfnSAMLProvider.CFN_RESOURCE_TYPE_NAME

    public operator fun invoke(
      scope: CloudshiftdevConstructsConstruct,
      id: String,
      block: Builder.() -> Unit = {},
    ): CfnSAMLProvider {
      val builderImpl = BuilderImpl(CloudshiftdevConstructsConstruct.unwrap(scope), id)
      return CfnSAMLProvider(builderImpl.apply(block).build())
    }

    internal fun wrap(cdkObject: software.amazon.awscdk.services.iam.CfnSAMLProvider):
        CfnSAMLProvider = CfnSAMLProvider(cdkObject)

    internal fun unwrap(wrapped: CfnSAMLProvider):
        software.amazon.awscdk.services.iam.CfnSAMLProvider = wrapped.cdkObject as
        software.amazon.awscdk.services.iam.CfnSAMLProvider
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy