Updates the configuration of an existing IAM OpenID Connect (OIDC) identity provider resource object. Use this operation to set, change, or remove the trusted identity propagation context provider, and to associate or disassociate an IAM Identity Center instance with the provider.
This operation does not update the OIDC provider's server certificate thumbprints. Thumbprints are managed only by the UpdateOpenIDConnectProviderThumbprint operation. To change a provider's thumbprints, call that operation instead.
To remove a configuration rather than replace it, use the RemoveContextProvider and RemoveIdentityCenterInstance parameters. For each configuration, provide either the new value or the corresponding Remove flag in a single request, but not both. For example, specifying both ContextProvider and RemoveContextProvider in the same request is not allowed.
A single request can change either the context provider or the IAM Identity Center association, but not both. To change both, make separate UpdateOpenIDConnectProvider requests. To remove the context provider, first remove the IAM Identity Center association in a separate request.
To control who can configure trusted identity propagation on an OIDC provider, use the iam:EnableIdentityPropagation, iam:EnableIdentityCenterAssociation, iam:ResourceIdentityProviderIssuers, iam:RequestIdentityCenterInstanceArn, and iam:ResourceIdentityCenterInstanceArn condition keys in IAM policies. The Request keys contain the values in the request. The Resource keys contain the values stored on the provider.
Parameters:
-
open_id_connect_provider_arn
(arnType)
–
The Amazon Resource Name (ARN) of the IAM OIDC provider resource object to update. You can get a list of OIDC provider resource ARNs by using the ListOpenIDConnectProviders operation.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.
-
context_provider
(Optional[ContextProvider], default:
None
)
–
The trusted identity propagation context provider configuration to set on the OIDC provider. This configuration defines the subject mapping and the source-to-target key mappings that are used when trusted context is injected. For more information, see ContextProvider.
To remove the existing context provider instead of replacing it, use RemoveContextProvider. Do not specify both ContextProvider and RemoveContextProvider in the same request.
-
identity_center_instance_arn
(Optional[identityCenterInstanceArnType], default:
None
)
–
The Amazon Resource Name (ARN) of the IAM Identity Center instance to associate with the OIDC provider.
For the format, see InstanceMetadata in the IAM Identity Center API Reference.
To disassociate the currently associated instance instead of changing it, use RemoveIdentityCenterInstance. Do not specify both IdentityCenterInstanceArn and RemoveIdentityCenterInstance in the same request.
-
remove_context_provider
(Optional[booleanType], default:
None
)
–
Specifies whether to remove the existing context provider configuration from the OIDC provider. Set this value to true to remove the context provider.
This parameter is mutually exclusive with ContextProvider. In a single request, specify either a new ContextProvider value or RemoveContextProvider, but not both.
-
remove_identity_center_instance
(Optional[booleanType], default:
None
)
–
Specifies whether to disassociate the IAM Identity Center instance from the OIDC provider. Set this value to true to remove the association.
This parameter is mutually exclusive with IdentityCenterInstanceArn. In a single request, specify either a new IdentityCenterInstanceArn value or RemoveIdentityCenterInstance, but not both.
Raises:
-
ConcurrentModificationException
–
The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.
-
InvalidInputException
–
The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
-
NoSuchEntityException
–
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
ServiceFailureException
–
The request processing has failed because of an unknown error, exception or failure.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To set the context provider for an OIDC provider
The following example sets a trusted identity propagation context provider on an existing OIDC provider. The context provider uses the sub claim as the subject and maps the department claim to a trusted context key.
>>> client.update_open_id_connect_provider(open_id_connect_provider_arn='arn:aws:iam::123456789012:oidc-provider/server.example.com', context_provider={'SubjectSourceKey': 'sub', 'SubjectTypeValue': 'user', 'KeyDefinitionList': [{'SourceKey': 'department', 'TargetKey': 'department'}]})
To associate an IAM Identity Center instance with an OIDC provider
The following example associates an IAM Identity Center instance with an existing OIDC provider.
>>> client.update_open_id_connect_provider(open_id_connect_provider_arn='arn:aws:iam::123456789012:oidc-provider/server.example.com', identity_center_instance_arn='arn:aws:sso:::instance/ssoins-1234567890abcdef')
Source code in docs_src/capo_iam/_services/iam.py
| def update_open_id_connect_provider(
self,
open_id_connect_provider_arn: "capo_iam.types.arn_type.arnType",
*,
config_overrides: Optional[IAMClientConfig] = None,
context_provider: Optional[
"capo_iam.types.context_provider.ContextProvider"
] = None,
identity_center_instance_arn: Optional[
"capo_iam.types.identity_center_instance_arn_type.identityCenterInstanceArnType"
] = None,
remove_context_provider: Optional[
"capo_iam.types.boolean_type.booleanType"
] = None,
remove_identity_center_instance: Optional[
"capo_iam.types.boolean_type.booleanType"
] = None,
) -> None:
"""<p>Updates the configuration of an existing IAM OpenID Connect (OIDC) identity provider resource object. Use this operation to set, change, or remove the trusted identity propagation context provider, and to associate or disassociate an IAM Identity Center instance with the provider.</p> <note> <p>This operation does not update the OIDC provider's server certificate thumbprints. Thumbprints are managed only by the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateOpenIDConnectProviderThumbprint.html">UpdateOpenIDConnectProviderThumbprint</a> operation. To change a provider's thumbprints, call that operation instead.</p> </note> <p>To remove a configuration rather than replace it, use the <code>RemoveContextProvider</code> and <code>RemoveIdentityCenterInstance</code> parameters. For each configuration, provide either the new value or the corresponding <code>Remove</code> flag in a single request, but not both. For example, specifying both <code>ContextProvider</code> and <code>RemoveContextProvider</code> in the same request is not allowed.</p> <p>A single request can change either the context provider or the IAM Identity Center association, but not both. To change both, make separate <code>UpdateOpenIDConnectProvider</code> requests. To remove the context provider, first remove the IAM Identity Center association in a separate request.</p> <p>To control who can configure trusted identity propagation on an OIDC provider, use the <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_EnableIdentityPropagation">iam:EnableIdentityPropagation</a>, <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_EnableIdentityCenterAssociation">iam:EnableIdentityCenterAssociation</a>, <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_ResourceIdentityProviderIssuers">iam:ResourceIdentityProviderIssuers</a>, <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_RequestIdentityCenterInstanceArn">iam:RequestIdentityCenterInstanceArn</a>, and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_ResourceIdentityCenterInstanceArn">iam:ResourceIdentityCenterInstanceArn</a> condition keys in IAM policies. The <code>Request</code> keys contain the values in the request. The <code>Resource</code> keys contain the values stored on the provider.</p>
Args:
open_id_connect_provider_arn: <p>The Amazon Resource Name (ARN) of the IAM OIDC provider resource object to update. You can get a list of OIDC provider resource ARNs by using the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListOpenIDConnectProviders.html">ListOpenIDConnectProviders</a> operation.</p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i>.</p>
context_provider: <p>The trusted identity propagation context provider configuration to set on the OIDC provider. This configuration defines the subject mapping and the source-to-target key mappings that are used when trusted context is injected. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_ContextProvider.html">ContextProvider</a>.</p> <p>To remove the existing context provider instead of replacing it, use <code>RemoveContextProvider</code>. Do not specify both <code>ContextProvider</code> and <code>RemoveContextProvider</code> in the same request.</p>
identity_center_instance_arn: <p>The Amazon Resource Name (ARN) of the IAM Identity Center instance to associate with the OIDC provider.</p> <p>For the format, see <a href="https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_InstanceMetadata.html">InstanceMetadata</a> in the <i>IAM Identity Center API Reference</i>.</p> <p>To disassociate the currently associated instance instead of changing it, use <code>RemoveIdentityCenterInstance</code>. Do not specify both <code>IdentityCenterInstanceArn</code> and <code>RemoveIdentityCenterInstance</code> in the same request.</p>
remove_context_provider: <p>Specifies whether to remove the existing context provider configuration from the OIDC provider. Set this value to <code>true</code> to remove the context provider.</p> <p>This parameter is mutually exclusive with <code>ContextProvider</code>. In a single request, specify either a new <code>ContextProvider</code> value or <code>RemoveContextProvider</code>, but not both.</p>
remove_identity_center_instance: <p>Specifies whether to disassociate the IAM Identity Center instance from the OIDC provider. Set this value to <code>true</code> to remove the association.</p> <p>This parameter is mutually exclusive with <code>IdentityCenterInstanceArn</code>. In a single request, specify either a new <code>IdentityCenterInstanceArn</code> value or <code>RemoveIdentityCenterInstance</code>, but not both.</p>
Raises:
capo_iam.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The request was rejected because multiple requests to change this object were submitted simultaneously. Wait a few minutes and submit your request again.</p>
capo_iam.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because an invalid or out-of-range value was supplied for an input parameter.</p>
capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
capo_iam.errors.service_failure_exception.ServiceFailureException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To set the context provider for an OIDC provider
The following example sets a trusted identity propagation context provider on an existing OIDC provider. The context provider uses the sub claim as the subject and maps the department claim to a trusted context key.
>>> client.update_open_id_connect_provider(open_id_connect_provider_arn='arn:aws:iam::123456789012:oidc-provider/server.example.com', context_provider={'SubjectSourceKey': 'sub', 'SubjectTypeValue': 'user', 'KeyDefinitionList': [{'SourceKey': 'department', 'TargetKey': 'department'}]})
To associate an IAM Identity Center instance with an OIDC provider
The following example associates an IAM Identity Center instance with an existing OIDC provider.
>>> client.update_open_id_connect_provider(open_id_connect_provider_arn='arn:aws:iam::123456789012:oidc-provider/server.example.com', identity_center_instance_arn='arn:aws:sso:::instance/ssoins-1234567890abcdef')
"""
def _handler(
req: "OperationRequest[capo_iam.types.update_open_id_connect_provider_request.UpdateOpenIDConnectProviderRequest]",
) -> OperationResponse[None]:
import capo_iam._operations.aws_identity_management_v20100508.update_open_id_connect_provider
output, http_response = (
capo_iam._operations.aws_identity_management_v20100508.update_open_id_connect_provider.update_open_id_connect_provider(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateOpenIDConnectProvider")
)
input_: capo_iam.types.update_open_id_connect_provider_request.UpdateOpenIDConnectProviderRequest = {
"open_id_connect_provider_arn": open_id_connect_provider_arn
}
if context_provider is not None:
input_["context_provider"] = context_provider
if identity_center_instance_arn is not None:
input_["identity_center_instance_arn"] = identity_center_instance_arn
if remove_context_provider is not None:
input_["remove_context_provider"] = remove_context_provider
if remove_identity_center_instance is not None:
input_["remove_identity_center_instance"] = remove_identity_center_instance
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|