aws_sdk_iam/operation/create_open_id_connect_provider/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_open_id_connect_provider::_create_open_id_connect_provider_output::CreateOpenIdConnectProviderOutputBuilder;
3
4pub use crate::operation::create_open_id_connect_provider::_create_open_id_connect_provider_input::CreateOpenIdConnectProviderInputBuilder;
5
6impl crate::operation::create_open_id_connect_provider::builders::CreateOpenIdConnectProviderInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_open_id_connect_provider::CreateOpenIdConnectProviderOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_open_id_connect_provider::CreateOpenIDConnectProviderError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_open_id_connect_provider();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateOpenIDConnectProvider`.
24///
25/// <p>Creates an IAM entity to describe an identity provider (IdP) that supports <a href="http://openid.net/connect/">OpenID Connect (OIDC)</a>.</p>
26/// <p>The OIDC provider that you create with this operation can be used as a principal in a role's trust policy. Such a policy establishes a trust relationship between Amazon Web Services and the OIDC provider.</p>
27/// <p>If you are using an OIDC identity provider from Google, Facebook, or Amazon Cognito, you don't need to create a separate IAM identity provider. These OIDC identity providers are already built-in to Amazon Web Services and are available for your use. Instead, you can move directly to creating new roles using your identity provider. To learn more, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_oidc.html">Creating a role for web identity or OpenID connect federation</a> in the <i>IAM User Guide</i>.</p>
28/// <p>When you create the IAM OIDC provider, you specify the following:</p>
29/// <ul>
30/// <li>
31/// <p>The URL of the OIDC identity provider (IdP) to trust</p></li>
32/// <li>
33/// <p>A list of client IDs (also known as audiences) that identify the application or applications allowed to authenticate using the OIDC provider</p></li>
34/// <li>
35/// <p>A list of tags that are attached to the specified IAM OIDC provider</p></li>
36/// <li>
37/// <p>A list of thumbprints of one or more server certificates that the IdP uses</p></li>
38/// </ul>
39/// <p>You get all of this information from the OIDC IdP you want to use to access Amazon Web Services.</p><note>
40/// <p>Amazon Web Services secures communication with OIDC identity providers (IdPs) using our library of trusted root certificate authorities (CAs) to verify the JSON Web Key Set (JWKS) endpoint's TLS certificate. If your OIDC IdP relies on a certificate that is not signed by one of these trusted CAs, only then we secure communication using the thumbprints set in the IdP's configuration.</p>
41/// </note> <note>
42/// <p>The trust for the OIDC provider is derived from the IAM provider that this operation creates. Therefore, it is best to limit access to the <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateOpenIDConnectProvider.html">CreateOpenIDConnectProvider</a> operation to highly privileged users.</p>
43/// </note>
44#[derive(::std::clone::Clone, ::std::fmt::Debug)]
45pub struct CreateOpenIDConnectProviderFluentBuilder {
46    handle: ::std::sync::Arc<crate::client::Handle>,
47    inner: crate::operation::create_open_id_connect_provider::builders::CreateOpenIdConnectProviderInputBuilder,
48    config_override: ::std::option::Option<crate::config::Builder>,
49}
50impl
51    crate::client::customize::internal::CustomizableSend<
52        crate::operation::create_open_id_connect_provider::CreateOpenIdConnectProviderOutput,
53        crate::operation::create_open_id_connect_provider::CreateOpenIDConnectProviderError,
54    > for CreateOpenIDConnectProviderFluentBuilder
55{
56    fn send(
57        self,
58        config_override: crate::config::Builder,
59    ) -> crate::client::customize::internal::BoxFuture<
60        crate::client::customize::internal::SendResult<
61            crate::operation::create_open_id_connect_provider::CreateOpenIdConnectProviderOutput,
62            crate::operation::create_open_id_connect_provider::CreateOpenIDConnectProviderError,
63        >,
64    > {
65        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66    }
67}
68impl CreateOpenIDConnectProviderFluentBuilder {
69    /// Creates a new `CreateOpenIDConnectProviderFluentBuilder`.
70    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71        Self {
72            handle,
73            inner: ::std::default::Default::default(),
74            config_override: ::std::option::Option::None,
75        }
76    }
77    /// Access the CreateOpenIDConnectProvider as a reference.
78    pub fn as_input(&self) -> &crate::operation::create_open_id_connect_provider::builders::CreateOpenIdConnectProviderInputBuilder {
79        &self.inner
80    }
81    /// Sends the request and returns the response.
82    ///
83    /// If an error occurs, an `SdkError` will be returned with additional details that
84    /// can be matched against.
85    ///
86    /// By default, any retryable failures will be retried twice. Retry behavior
87    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88    /// set when configuring the client.
89    pub async fn send(
90        self,
91    ) -> ::std::result::Result<
92        crate::operation::create_open_id_connect_provider::CreateOpenIdConnectProviderOutput,
93        ::aws_smithy_runtime_api::client::result::SdkError<
94            crate::operation::create_open_id_connect_provider::CreateOpenIDConnectProviderError,
95            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96        >,
97    > {
98        let input = self
99            .inner
100            .build()
101            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102        let runtime_plugins = crate::operation::create_open_id_connect_provider::CreateOpenIDConnectProvider::operation_runtime_plugins(
103            self.handle.runtime_plugins.clone(),
104            &self.handle.conf,
105            self.config_override,
106        );
107        crate::operation::create_open_id_connect_provider::CreateOpenIDConnectProvider::orchestrate(&runtime_plugins, input).await
108    }
109
110    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111    pub fn customize(
112        self,
113    ) -> crate::client::customize::CustomizableOperation<
114        crate::operation::create_open_id_connect_provider::CreateOpenIdConnectProviderOutput,
115        crate::operation::create_open_id_connect_provider::CreateOpenIDConnectProviderError,
116        Self,
117    > {
118        crate::client::customize::CustomizableOperation::new(self)
119    }
120    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121        self.set_config_override(::std::option::Option::Some(config_override.into()));
122        self
123    }
124
125    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126        self.config_override = config_override;
127        self
128    }
129    /// <p>The URL of the identity provider. The URL must begin with <code>https://</code> and should correspond to the <code>iss</code> claim in the provider's OpenID Connect ID tokens. Per the OIDC standard, path components are allowed but query parameters are not. Typically the URL consists of only a hostname, like <code>https://server.example.org</code> or <code>https://example.com</code>. The URL should not contain a port number.</p>
130    /// <p>You cannot register the same provider multiple times in a single Amazon Web Services account. If you try to submit a URL that has already been used for an OpenID Connect provider in the Amazon Web Services account, you will get an error.</p>
131    pub fn url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.url(input.into());
133        self
134    }
135    /// <p>The URL of the identity provider. The URL must begin with <code>https://</code> and should correspond to the <code>iss</code> claim in the provider's OpenID Connect ID tokens. Per the OIDC standard, path components are allowed but query parameters are not. Typically the URL consists of only a hostname, like <code>https://server.example.org</code> or <code>https://example.com</code>. The URL should not contain a port number.</p>
136    /// <p>You cannot register the same provider multiple times in a single Amazon Web Services account. If you try to submit a URL that has already been used for an OpenID Connect provider in the Amazon Web Services account, you will get an error.</p>
137    pub fn set_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_url(input);
139        self
140    }
141    /// <p>The URL of the identity provider. The URL must begin with <code>https://</code> and should correspond to the <code>iss</code> claim in the provider's OpenID Connect ID tokens. Per the OIDC standard, path components are allowed but query parameters are not. Typically the URL consists of only a hostname, like <code>https://server.example.org</code> or <code>https://example.com</code>. The URL should not contain a port number.</p>
142    /// <p>You cannot register the same provider multiple times in a single Amazon Web Services account. If you try to submit a URL that has already been used for an OpenID Connect provider in the Amazon Web Services account, you will get an error.</p>
143    pub fn get_url(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_url()
145    }
146    ///
147    /// Appends an item to `ClientIDList`.
148    ///
149    /// To override the contents of this collection use [`set_client_id_list`](Self::set_client_id_list).
150    ///
151    /// <p>Provides a list of client IDs, also known as audiences. When a mobile or web app registers with an OpenID Connect provider, they establish a value that identifies the application. This is the value that's sent as the <code>client_id</code> parameter on OAuth requests.</p>
152    /// <p>You can register multiple client IDs with the same provider. For example, you might have multiple applications that use the same OIDC provider. You cannot register more than 100 client IDs with a single IAM OIDC provider.</p>
153    /// <p>There is no defined format for a client ID. The <code>CreateOpenIDConnectProviderRequest</code> operation accepts client IDs up to 255 characters long.</p>
154    pub fn client_id_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.client_id_list(input.into());
156        self
157    }
158    /// <p>Provides a list of client IDs, also known as audiences. When a mobile or web app registers with an OpenID Connect provider, they establish a value that identifies the application. This is the value that's sent as the <code>client_id</code> parameter on OAuth requests.</p>
159    /// <p>You can register multiple client IDs with the same provider. For example, you might have multiple applications that use the same OIDC provider. You cannot register more than 100 client IDs with a single IAM OIDC provider.</p>
160    /// <p>There is no defined format for a client ID. The <code>CreateOpenIDConnectProviderRequest</code> operation accepts client IDs up to 255 characters long.</p>
161    pub fn set_client_id_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
162        self.inner = self.inner.set_client_id_list(input);
163        self
164    }
165    /// <p>Provides a list of client IDs, also known as audiences. When a mobile or web app registers with an OpenID Connect provider, they establish a value that identifies the application. This is the value that's sent as the <code>client_id</code> parameter on OAuth requests.</p>
166    /// <p>You can register multiple client IDs with the same provider. For example, you might have multiple applications that use the same OIDC provider. You cannot register more than 100 client IDs with a single IAM OIDC provider.</p>
167    /// <p>There is no defined format for a client ID. The <code>CreateOpenIDConnectProviderRequest</code> operation accepts client IDs up to 255 characters long.</p>
168    pub fn get_client_id_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
169        self.inner.get_client_id_list()
170    }
171    ///
172    /// Appends an item to `ThumbprintList`.
173    ///
174    /// To override the contents of this collection use [`set_thumbprint_list`](Self::set_thumbprint_list).
175    ///
176    /// <p>A list of server certificate thumbprints for the OpenID Connect (OIDC) identity provider's server certificates. Typically this list includes only one entry. However, IAM lets you have up to five thumbprints for an OIDC provider. This lets you maintain multiple thumbprints if the identity provider is rotating certificates.</p>
177    /// <p>This parameter is optional. If it is not included, IAM will retrieve and use the top intermediate certificate authority (CA) thumbprint of the OpenID Connect identity provider server certificate.</p>
178    /// <p>The server certificate thumbprint is the hex-encoded SHA-1 hash value of the X.509 certificate used by the domain where the OpenID Connect provider makes its keys available. It is always a 40-character string.</p>
179    /// <p>For example, assume that the OIDC provider is <code>server.example.com</code> and the provider stores its keys at https://keys.server.example.com/openid-connect. In that case, the thumbprint string would be the hex-encoded SHA-1 hash value of the certificate used by <code>https://keys.server.example.com.</code></p>
180    /// <p>For more information about obtaining the OIDC provider thumbprint, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc-obtain-thumbprint.html">Obtaining the thumbprint for an OpenID Connect provider</a> in the <i>IAM user Guide</i>.</p>
181    pub fn thumbprint_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.thumbprint_list(input.into());
183        self
184    }
185    /// <p>A list of server certificate thumbprints for the OpenID Connect (OIDC) identity provider's server certificates. Typically this list includes only one entry. However, IAM lets you have up to five thumbprints for an OIDC provider. This lets you maintain multiple thumbprints if the identity provider is rotating certificates.</p>
186    /// <p>This parameter is optional. If it is not included, IAM will retrieve and use the top intermediate certificate authority (CA) thumbprint of the OpenID Connect identity provider server certificate.</p>
187    /// <p>The server certificate thumbprint is the hex-encoded SHA-1 hash value of the X.509 certificate used by the domain where the OpenID Connect provider makes its keys available. It is always a 40-character string.</p>
188    /// <p>For example, assume that the OIDC provider is <code>server.example.com</code> and the provider stores its keys at https://keys.server.example.com/openid-connect. In that case, the thumbprint string would be the hex-encoded SHA-1 hash value of the certificate used by <code>https://keys.server.example.com.</code></p>
189    /// <p>For more information about obtaining the OIDC provider thumbprint, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc-obtain-thumbprint.html">Obtaining the thumbprint for an OpenID Connect provider</a> in the <i>IAM user Guide</i>.</p>
190    pub fn set_thumbprint_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
191        self.inner = self.inner.set_thumbprint_list(input);
192        self
193    }
194    /// <p>A list of server certificate thumbprints for the OpenID Connect (OIDC) identity provider's server certificates. Typically this list includes only one entry. However, IAM lets you have up to five thumbprints for an OIDC provider. This lets you maintain multiple thumbprints if the identity provider is rotating certificates.</p>
195    /// <p>This parameter is optional. If it is not included, IAM will retrieve and use the top intermediate certificate authority (CA) thumbprint of the OpenID Connect identity provider server certificate.</p>
196    /// <p>The server certificate thumbprint is the hex-encoded SHA-1 hash value of the X.509 certificate used by the domain where the OpenID Connect provider makes its keys available. It is always a 40-character string.</p>
197    /// <p>For example, assume that the OIDC provider is <code>server.example.com</code> and the provider stores its keys at https://keys.server.example.com/openid-connect. In that case, the thumbprint string would be the hex-encoded SHA-1 hash value of the certificate used by <code>https://keys.server.example.com.</code></p>
198    /// <p>For more information about obtaining the OIDC provider thumbprint, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc-obtain-thumbprint.html">Obtaining the thumbprint for an OpenID Connect provider</a> in the <i>IAM user Guide</i>.</p>
199    pub fn get_thumbprint_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
200        self.inner.get_thumbprint_list()
201    }
202    ///
203    /// Appends an item to `Tags`.
204    ///
205    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
206    ///
207    /// <p>A list of tags that you want to attach to the new IAM OpenID Connect (OIDC) provider. Each tag consists of a key name and an associated value. For more information about tagging, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html">Tagging IAM resources</a> in the <i>IAM User Guide</i>.</p><note>
208    /// <p>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.</p>
209    /// </note>
210    pub fn tags(mut self, input: crate::types::Tag) -> Self {
211        self.inner = self.inner.tags(input);
212        self
213    }
214    /// <p>A list of tags that you want to attach to the new IAM OpenID Connect (OIDC) provider. Each tag consists of a key name and an associated value. For more information about tagging, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html">Tagging IAM resources</a> in the <i>IAM User Guide</i>.</p><note>
215    /// <p>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.</p>
216    /// </note>
217    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
218        self.inner = self.inner.set_tags(input);
219        self
220    }
221    /// <p>A list of tags that you want to attach to the new IAM OpenID Connect (OIDC) provider. Each tag consists of a key name and an associated value. For more information about tagging, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html">Tagging IAM resources</a> in the <i>IAM User Guide</i>.</p><note>
222    /// <p>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.</p>
223    /// </note>
224    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
225        self.inner.get_tags()
226    }
227}