Skip to main content

saml_providers

Creates, updates, deletes, gets or lists a saml_providers resource.

Overview

Namesaml_providers
TypeResource
Idaws.iam.saml_providers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
assertion_encryption_modestringSpecifies the encryption setting for the SAML provider.
create_datestringThe date and time when the SAML provider was created.
private_key_liststringThe private key metadata for the SAML provider.
saml_metadata_documentstringThe XML metadata document that includes information about an identity provider.
saml_provider_uuidstringThe unique identifier assigned to the SAML provider.
tagsstringA list of tags that are attached to the specified 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.
valid_untilstringThe expiration date and time for the SAML provider.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_saml_providerselectSAMLProviderArn, regionReturns the SAML provider metadocument that was uploaded when the IAM SAML provider resource object was created or updated. This operation requires Signature Version 4.
list_saml_providersselectregionLists the SAML provider resource objects defined in IAM in the account. IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a SAML provider, see GetSAMLProvider. This operation requires Signature Version 4.
create_saml_providerinsertSAMLMetadataDocument, Name, regionTags, AssertionEncryptionMode, AddPrivateKeyCreates 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. 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.
update_saml_providerupdateSAMLProviderArn, regionSAMLMetadataDocument, AssertionEncryptionMode, AddPrivateKey, RemovePrivateKeyUpdates the metadata document, SAML encryption settings, and private keys for an existing SAML provider. To rotate private keys, add your new private key and then remove the old key in a separate request.
delete_saml_providerdeleteSAMLProviderArn, regionDeletes a SAML provider resource in IAM. Deleting the provider resource from IAM does not update any roles that reference the SAML provider resource's ARN as a principal in their trust policies. Any attempt to assume a role that references a non-existent provider resource ARN fails. This operation requires Signature Version 4.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
NamestringThe 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: _+=,.@-
SAMLMetadataDocumentstringAn 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
SAMLProviderArnstringThe Amazon Resource Name (ARN) of the SAML provider to delete.
regionstringAWS region (default: us-east-1)
AddPrivateKeystringSpecifies the new private key 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.
AssertionEncryptionModestringSpecifies the encryption setting for the SAML provider.
RemovePrivateKeystringThe Key ID of the private key to remove.
SAMLMetadataDocumentstringAn 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 IdP.
TagsarrayA 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. 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.

SELECT examples

Returns the SAML provider metadocument that was uploaded when the IAM SAML provider resource object was created or updated. This operation requires Signature Version 4.

SELECT
assertion_encryption_mode,
create_date,
private_key_list,
saml_metadata_document,
saml_provider_uuid,
tags,
valid_until
FROM aws.iam.saml_providers
WHERE SAMLProviderArn = '{{ SAMLProviderArn }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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

INSERT INTO aws.iam.saml_providers (
SAMLMetadataDocument,
Name,
region,
Tags,
AssertionEncryptionMode,
AddPrivateKey
)
SELECT
'{{ SAMLMetadataDocument }}',
'{{ Name }}',
'{{ region }}',
'{{ Tags }}',
'{{ AssertionEncryptionMode }}',
'{{ AddPrivateKey }}'
RETURNING
saml_provider_arn,
tags
;

UPDATE examples

Updates the metadata document, SAML encryption settings, and private keys for an existing SAML provider. To rotate private keys, add your new private key and then remove the old key in a separate request.

UPDATE aws.iam.saml_providers
SET
-- No updatable properties
WHERE
SAMLProviderArn = '{{ SAMLProviderArn }}' --required
AND region = '{{ region }}' --required
AND SAMLMetadataDocument = '{{ SAMLMetadataDocument}}'
AND AssertionEncryptionMode = '{{ AssertionEncryptionMode}}'
AND AddPrivateKey = '{{ AddPrivateKey}}'
AND RemovePrivateKey = '{{ RemovePrivateKey}}'
RETURNING
saml_provider_arn;

DELETE examples

Deletes a SAML provider resource in IAM. Deleting the provider resource from IAM does not update any roles that reference the SAML provider resource's ARN as a principal in their trust policies. Any attempt to assume a role that references a non-existent provider resource ARN fails. This operation requires Signature Version 4.

DELETE FROM aws.iam.saml_providers
WHERE SAMLProviderArn = '{{ SAMLProviderArn }}' --required
AND region = '{{ region }}' --required
;