aws_sdk_ecr/client/
create_pull_through_cache_rule.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`CreatePullThroughCacheRule`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`ecr_repository_prefix(impl Into<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::ecr_repository_prefix) / [`set_ecr_repository_prefix(Option<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::set_ecr_repository_prefix):<br>required: **true**<br><p>The repository name prefix to use when caching images from the source registry.</p><important>  <p>There is always an assumed <code>/</code> applied to the end of the prefix. If you specify <code>ecr-public</code> as the prefix, Amazon ECR treats that as <code>ecr-public/</code>.</p> </important><br>
7    ///   - [`upstream_registry_url(impl Into<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::upstream_registry_url) / [`set_upstream_registry_url(Option<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::set_upstream_registry_url):<br>required: **true**<br><p>The registry URL of the upstream public registry to use as the source for the pull through cache rule. The following is the syntax to use for each supported upstream registry.</p> <ul>  <li>   <p>Amazon ECR (<code>ecr</code>) – <code><accountid>      .dkr.ecr.      <region>       .amazonaws.com      </region>     </accountid></code></p></li>  <li>   <p>Amazon ECR Public (<code>ecr-public</code>) – <code>public.ecr.aws</code></p></li>  <li>   <p>Docker Hub (<code>docker-hub</code>) – <code>registry-1.docker.io</code></p></li>  <li>   <p>GitHub Container Registry (<code>github-container-registry</code>) – <code>ghcr.io</code></p></li>  <li>   <p>GitLab Container Registry (<code>gitlab-container-registry</code>) – <code>registry.gitlab.com</code></p></li>  <li>   <p>Kubernetes (<code>k8s</code>) – <code>registry.k8s.io</code></p></li>  <li>   <p>Microsoft Azure Container Registry (<code>azure-container-registry</code>) – <code><custom>      .azurecr.io     </custom></code></p></li>  <li>   <p>Quay (<code>quay</code>) – <code>quay.io</code></p></li> </ul><br>
8    ///   - [`registry_id(impl Into<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::registry_id) / [`set_registry_id(Option<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::set_registry_id):<br>required: **false**<br><p>The Amazon Web Services account ID associated with the registry to create the pull through cache rule for. If you do not specify a registry, the default registry is assumed.</p><br>
9    ///   - [`upstream_registry(UpstreamRegistry)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::upstream_registry) / [`set_upstream_registry(Option<UpstreamRegistry>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::set_upstream_registry):<br>required: **false**<br><p>The name of the upstream registry.</p><br>
10    ///   - [`credential_arn(impl Into<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::credential_arn) / [`set_credential_arn(Option<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::set_credential_arn):<br>required: **false**<br><p>The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that identifies the credentials to authenticate to the upstream registry.</p><br>
11    ///   - [`custom_role_arn(impl Into<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::custom_role_arn) / [`set_custom_role_arn(Option<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::set_custom_role_arn):<br>required: **false**<br><p>Amazon Resource Name (ARN) of the IAM role to be assumed by Amazon ECR to authenticate to the ECR upstream registry. This role must be in the same account as the registry that you are configuring.</p><br>
12    ///   - [`upstream_repository_prefix(impl Into<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::upstream_repository_prefix) / [`set_upstream_repository_prefix(Option<String>)`](crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::set_upstream_repository_prefix):<br>required: **false**<br><p>The repository name prefix of the upstream registry to match with the upstream repository name. When this field isn't specified, Amazon ECR will use the <code>ROOT</code>.</p><br>
13    /// - On success, responds with [`CreatePullThroughCacheRuleOutput`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput) with field(s):
14    ///   - [`ecr_repository_prefix(Option<String>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::ecr_repository_prefix): <p>The Amazon ECR repository prefix associated with the pull through cache rule.</p>
15    ///   - [`upstream_registry_url(Option<String>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::upstream_registry_url): <p>The upstream registry URL associated with the pull through cache rule.</p>
16    ///   - [`created_at(Option<DateTime>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::created_at): <p>The date and time, in JavaScript date format, when the pull through cache rule was created.</p>
17    ///   - [`registry_id(Option<String>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::registry_id): <p>The registry ID associated with the request.</p>
18    ///   - [`upstream_registry(Option<UpstreamRegistry>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::upstream_registry): <p>The name of the upstream registry associated with the pull through cache rule.</p>
19    ///   - [`credential_arn(Option<String>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::credential_arn): <p>The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret associated with the pull through cache rule.</p>
20    ///   - [`custom_role_arn(Option<String>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::custom_role_arn): <p>The ARN of the IAM role associated with the pull through cache rule.</p>
21    ///   - [`upstream_repository_prefix(Option<String>)`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleOutput::upstream_repository_prefix): <p>The upstream repository prefix associated with the pull through cache rule.</p>
22    /// - On failure, responds with [`SdkError<CreatePullThroughCacheRuleError>`](crate::operation::create_pull_through_cache_rule::CreatePullThroughCacheRuleError)
23    pub fn create_pull_through_cache_rule(
24        &self,
25    ) -> crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder {
26        crate::operation::create_pull_through_cache_rule::builders::CreatePullThroughCacheRuleFluentBuilder::new(self.handle.clone())
27    }
28}