aws-cdk-lib.aws_iam.SamlProvider

class SamlProvider (construct)

LanguageType name
.NETAmazon.CDK.AWS.IAM.SamlProvider
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsiam#SamlProvider
Javasoftware.amazon.awscdk.services.iam.SamlProvider
Pythonaws_cdk.aws_iam.SamlProvider
TypeScript (source)aws-cdk-lib » aws_iam » SamlProvider

Implements IConstruct, IDependable, IResource, ISamlProvider

A SAML provider.

Example

const provider = new iam.SamlProvider(this, 'Provider', {
  metadataDocument: iam.SamlMetadataDocument.fromFile('/path/to/saml-metadata-document.xml'),
});
new iam.Role(this, 'Role', {
  assumedBy: new iam.SamlConsolePrincipal(provider),
});

Initializer

new SamlProvider(scope: Construct, id: string, props: SamlProviderProps)

Parameters

  • scope Construct
  • id string
  • props SamlProviderProps

Construct Props

NameTypeDescription
metadataDocumentSamlMetadataDocumentAn 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.
name?stringThe name of the provider to create.

metadataDocument

Type: 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.


name?

Type: string (optional, default: a CloudFormation generated name)

The name of the provider to create.

This parameter allows a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-

Length must be between 1 and 128 characters.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
samlProviderArnstringThe Amazon Resource Name (ARN) of the provider.
stackStackThe stack in which this resource is defined.

env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


samlProviderArn

Type: string

The Amazon Resource Name (ARN) of the provider.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromSamlProviderArn(scope, id, samlProviderArn)Import an existing provider.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromSamlProviderArn(scope, id, samlProviderArn)

public static fromSamlProviderArn(scope: Construct, id: string, samlProviderArn: string): ISamlProvider

Parameters

  • scope Construct
  • id string
  • samlProviderArn string

Returns

  • ISamlProvider

Import an existing provider.