Skip to content

IAM  >  Operations  >  create_saml_provider

create_saml_provider

Operation

create_saml_provider async

create_saml_provider(input: CreateSAMLProviderInput, plugins: list[Plugin] | None = None) -> CreateSAMLProviderOutput

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 Amazon Web Services Management Console or one that supports API access to Amazon Web Services.

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.

Note

This operation requires Signature Version 4.

For more information, see Enabling SAML 2.0 federated users to access the Amazon Web Services Management Console and About SAML 2.0-based federation in the IAM User Guide.

Parameters:

Name Type Description Default
input CreateSAMLProviderInput

An instance of CreateSAMLProviderInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateSAMLProviderOutput

An instance of CreateSAMLProviderOutput.

Input

CreateSAMLProviderInput dataclass

Bases: _SerdeShape

Dataclass for CreateSAMLProviderInput structure.

Attributes

add_private_key class-attribute instance-attribute
add_private_key: str | None = ...

The private key generated from your external identity provider. The private key must be a .pem file that uses AES-GCM or AES-CBC encryption algorithm to decrypt SAML assertions.

assertion_encryption_mode class-attribute instance-attribute
assertion_encryption_mode: str | None = ...

Specifies the encryption setting for the SAML provider.

name class-attribute instance-attribute
name: str | None = ...

The name of the provider to create.

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

saml_metadata_document class-attribute instance-attribute
saml_metadata_document: str | None = ...

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 in the IAM User Guide

tags class-attribute instance-attribute
tags: list[Tag] | None = ...

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 in the IAM User Guide.

Note

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.

Output

CreateSAMLProviderOutput dataclass

Bases: _SerdeShape

Contains the response to a successful CreateSAMLProvider request.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

saml_provider_arn class-attribute instance-attribute
saml_provider_arn: str | None = ...

The Amazon Resource Name (ARN) of the new SAML provider resource in IAM.

tags class-attribute instance-attribute
tags: list[Tag] | None = ...

A list of tags that are attached to the new IAM SAML provider. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide.