All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.eks.model.PodIdentityAssociation Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.eks.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Amazon EKS Pod Identity associations provide the ability to manage credentials for your applications, similar to the * way that Amazon EC2 instance profiles provide credentials to Amazon EC2 instances. *

*/ @Generated("software.amazon.awssdk:codegen") public final class PodIdentityAssociation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("clusterName").getter(getter(PodIdentityAssociation::clusterName)).setter(setter(Builder::clusterName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clusterName").build()).build(); private static final SdkField NAMESPACE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("namespace").getter(getter(PodIdentityAssociation::namespace)).setter(setter(Builder::namespace)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("namespace").build()).build(); private static final SdkField SERVICE_ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("serviceAccount").getter(getter(PodIdentityAssociation::serviceAccount)) .setter(setter(Builder::serviceAccount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceAccount").build()).build(); private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("roleArn").getter(getter(PodIdentityAssociation::roleArn)).setter(setter(Builder::roleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build(); private static final SdkField ASSOCIATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("associationArn").getter(getter(PodIdentityAssociation::associationArn)) .setter(setter(Builder::associationArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associationArn").build()).build(); private static final SdkField ASSOCIATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("associationId").getter(getter(PodIdentityAssociation::associationId)) .setter(setter(Builder::associationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("associationId").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("tags") .getter(getter(PodIdentityAssociation::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("createdAt").getter(getter(PodIdentityAssociation::createdAt)).setter(setter(Builder::createdAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build(); private static final SdkField MODIFIED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("modifiedAt").getter(getter(PodIdentityAssociation::modifiedAt)).setter(setter(Builder::modifiedAt)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modifiedAt").build()).build(); private static final SdkField OWNER_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ownerArn").getter(getter(PodIdentityAssociation::ownerArn)).setter(setter(Builder::ownerArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerArn").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_NAME_FIELD, NAMESPACE_FIELD, SERVICE_ACCOUNT_FIELD, ROLE_ARN_FIELD, ASSOCIATION_ARN_FIELD, ASSOCIATION_ID_FIELD, TAGS_FIELD, CREATED_AT_FIELD, MODIFIED_AT_FIELD, OWNER_ARN_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String clusterName; private final String namespace; private final String serviceAccount; private final String roleArn; private final String associationArn; private final String associationId; private final Map tags; private final Instant createdAt; private final Instant modifiedAt; private final String ownerArn; private PodIdentityAssociation(BuilderImpl builder) { this.clusterName = builder.clusterName; this.namespace = builder.namespace; this.serviceAccount = builder.serviceAccount; this.roleArn = builder.roleArn; this.associationArn = builder.associationArn; this.associationId = builder.associationId; this.tags = builder.tags; this.createdAt = builder.createdAt; this.modifiedAt = builder.modifiedAt; this.ownerArn = builder.ownerArn; } /** *

* The name of the cluster that the association is in. *

* * @return The name of the cluster that the association is in. */ public final String clusterName() { return clusterName; } /** *

* The name of the Kubernetes namespace inside the cluster to create the association in. The service account and the * pods that use the service account must be in this namespace. *

* * @return The name of the Kubernetes namespace inside the cluster to create the association in. The service account * and the pods that use the service account must be in this namespace. */ public final String namespace() { return namespace; } /** *

* The name of the Kubernetes service account inside the cluster to associate the IAM credentials with. *

* * @return The name of the Kubernetes service account inside the cluster to associate the IAM credentials with. */ public final String serviceAccount() { return serviceAccount; } /** *

* The Amazon Resource Name (ARN) of the IAM role to associate with the service account. The EKS Pod Identity agent * manages credentials to assume this role for applications in the containers in the pods that use this service * account. *

* * @return The Amazon Resource Name (ARN) of the IAM role to associate with the service account. The EKS Pod * Identity agent manages credentials to assume this role for applications in the containers in the pods * that use this service account. */ public final String roleArn() { return roleArn; } /** *

* The Amazon Resource Name (ARN) of the association. *

* * @return The Amazon Resource Name (ARN) of the association. */ public final String associationArn() { return associationArn; } /** *

* The ID of the association. *

* * @return The ID of the association. */ public final String associationId() { return associationId; } /** * For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You * define both. Tags don't propagate to any other cluster or Amazon Web Services resources. *

*

* The following basic restrictions apply to tags: *

*
    *
  • *

    * Maximum number of tags per resource – 50 *

    *
  • *
  • *

    * For each resource, each tag key must be unique, and each tag key can have only one value. *

    *
  • *
  • *

    * Maximum key length – 128 Unicode characters in UTF-8 *

    *
  • *
  • *

    * Maximum value length – 256 Unicode characters in UTF-8 *

    *
  • *
  • *

    * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable * in UTF-8, and the following characters: + - = . _ : / @. *

    *
  • *
  • *

    * Tag keys and values are case-sensitive. *

    *
  • *
  • *

    * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for * either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values * with this prefix. Tags with this prefix do not count against your tags per resource limit. *

    *
  • *
*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasTags} method. *

* * @return Metadata that assists with categorization and organization. Each tag consists of a key and an optional * value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.

*

* The following basic restrictions apply to tags: *

*
    *
  • *

    * Maximum number of tags per resource – 50 *

    *
  • *
  • *

    * For each resource, each tag key must be unique, and each tag key can have only one value. *

    *
  • *
  • *

    * Maximum key length – 128 Unicode characters in UTF-8 *

    *
  • *
  • *

    * Maximum value length – 256 Unicode characters in UTF-8 *

    *
  • *
  • *

    * If your tagging schema is used across multiple services and resources, remember that other services may * have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

    *
  • *
  • *

    * Tag keys and values are case-sensitive. *

    *
  • *
  • *

    * Do not use aws:, AWS:, or any upper or lowercase combination of such as a * prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete * tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource * limit. *

    *
  • */ public final Map tags() { return tags; } /** *

    * The timestamp that the association was created at. *

    * * @return The timestamp that the association was created at. */ public final Instant createdAt() { return createdAt; } /** *

    * The most recent timestamp that the association was modified at *

    * * @return The most recent timestamp that the association was modified at */ public final Instant modifiedAt() { return modifiedAt; } /** *

    * If defined, the Pod Identity Association is owned by an Amazon EKS Addon. *

    * * @return If defined, the Pod Identity Association is owned by an Amazon EKS Addon. */ public final String ownerArn() { return ownerArn; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(clusterName()); hashCode = 31 * hashCode + Objects.hashCode(namespace()); hashCode = 31 * hashCode + Objects.hashCode(serviceAccount()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(associationArn()); hashCode = 31 * hashCode + Objects.hashCode(associationId()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(modifiedAt()); hashCode = 31 * hashCode + Objects.hashCode(ownerArn()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof PodIdentityAssociation)) { return false; } PodIdentityAssociation other = (PodIdentityAssociation) obj; return Objects.equals(clusterName(), other.clusterName()) && Objects.equals(namespace(), other.namespace()) && Objects.equals(serviceAccount(), other.serviceAccount()) && Objects.equals(roleArn(), other.roleArn()) && Objects.equals(associationArn(), other.associationArn()) && Objects.equals(associationId(), other.associationId()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(modifiedAt(), other.modifiedAt()) && Objects.equals(ownerArn(), other.ownerArn()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("PodIdentityAssociation").add("ClusterName", clusterName()).add("Namespace", namespace()) .add("ServiceAccount", serviceAccount()).add("RoleArn", roleArn()).add("AssociationArn", associationArn()) .add("AssociationId", associationId()).add("Tags", hasTags() ? tags() : null).add("CreatedAt", createdAt()) .add("ModifiedAt", modifiedAt()).add("OwnerArn", ownerArn()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "clusterName": return Optional.ofNullable(clazz.cast(clusterName())); case "namespace": return Optional.ofNullable(clazz.cast(namespace())); case "serviceAccount": return Optional.ofNullable(clazz.cast(serviceAccount())); case "roleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "associationArn": return Optional.ofNullable(clazz.cast(associationArn())); case "associationId": return Optional.ofNullable(clazz.cast(associationId())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "createdAt": return Optional.ofNullable(clazz.cast(createdAt())); case "modifiedAt": return Optional.ofNullable(clazz.cast(modifiedAt())); case "ownerArn": return Optional.ofNullable(clazz.cast(ownerArn())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("clusterName", CLUSTER_NAME_FIELD); map.put("namespace", NAMESPACE_FIELD); map.put("serviceAccount", SERVICE_ACCOUNT_FIELD); map.put("roleArn", ROLE_ARN_FIELD); map.put("associationArn", ASSOCIATION_ARN_FIELD); map.put("associationId", ASSOCIATION_ID_FIELD); map.put("tags", TAGS_FIELD); map.put("createdAt", CREATED_AT_FIELD); map.put("modifiedAt", MODIFIED_AT_FIELD); map.put("ownerArn", OWNER_ARN_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((PodIdentityAssociation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The name of the cluster that the association is in. *

    * * @param clusterName * The name of the cluster that the association is in. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clusterName(String clusterName); /** *

    * The name of the Kubernetes namespace inside the cluster to create the association in. The service account and * the pods that use the service account must be in this namespace. *

    * * @param namespace * The name of the Kubernetes namespace inside the cluster to create the association in. The service * account and the pods that use the service account must be in this namespace. * @return Returns a reference to this object so that method calls can be chained together. */ Builder namespace(String namespace); /** *

    * The name of the Kubernetes service account inside the cluster to associate the IAM credentials with. *

    * * @param serviceAccount * The name of the Kubernetes service account inside the cluster to associate the IAM credentials with. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serviceAccount(String serviceAccount); /** *

    * The Amazon Resource Name (ARN) of the IAM role to associate with the service account. The EKS Pod Identity * agent manages credentials to assume this role for applications in the containers in the pods that use this * service account. *

    * * @param roleArn * The Amazon Resource Name (ARN) of the IAM role to associate with the service account. The EKS Pod * Identity agent manages credentials to assume this role for applications in the containers in the pods * that use this service account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

    * The Amazon Resource Name (ARN) of the association. *

    * * @param associationArn * The Amazon Resource Name (ARN) of the association. * @return Returns a reference to this object so that method calls can be chained together. */ Builder associationArn(String associationArn); /** *

    * The ID of the association. *

    * * @param associationId * The ID of the association. * @return Returns a reference to this object so that method calls can be chained together. */ Builder associationId(String associationId); /** *

    * Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. * You define both. Tags don't propagate to any other cluster or Amazon Web Services resources. *

    *

    * The following basic restrictions apply to tags: *

    *
      *
    • *

      * Maximum number of tags per resource – 50 *

      *
    • *
    • *

      * For each resource, each tag key must be unique, and each tag key can have only one value. *

      *
    • *
    • *

      * Maximum key length – 128 Unicode characters in UTF-8 *

      *
    • *
    • *

      * Maximum value length – 256 Unicode characters in UTF-8 *

      *
    • *
    • *

      * If your tagging schema is used across multiple services and resources, remember that other services may have * restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces * representable in UTF-8, and the following characters: + - = . _ : / @. *

      *
    • *
    • *

      * Tag keys and values are case-sensitive. *

      *
    • *
    • *

      * Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix * for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys * or values with this prefix. Tags with this prefix do not count against your tags per resource limit. *

      *
    • *
    * * @param tags * Metadata that assists with categorization and organization. Each tag consists of a key and an optional * value. You define both. Tags don't propagate to any other cluster or Amazon Web Services * resources.

    *

    * The following basic restrictions apply to tags: *

    *
      *
    • *

      * Maximum number of tags per resource – 50 *

      *
    • *
    • *

      * For each resource, each tag key must be unique, and each tag key can have only one value. *

      *
    • *
    • *

      * Maximum key length – 128 Unicode characters in UTF-8 *

      *
    • *
    • *

      * Maximum value length – 256 Unicode characters in UTF-8 *

      *
    • *
    • *

      * If your tagging schema is used across multiple services and resources, remember that other services * may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and * spaces representable in UTF-8, and the following characters: + - = . _ : / @. *

      *
    • *
    • *

      * Tag keys and values are case-sensitive. *

      *
    • *
    • *

      * Do not use aws:, AWS:, or any upper or lowercase combination of such as a * prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or * delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per * resource limit. *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

      * The timestamp that the association was created at. *

      * * @param createdAt * The timestamp that the association was created at. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

      * The most recent timestamp that the association was modified at *

      * * @param modifiedAt * The most recent timestamp that the association was modified at * @return Returns a reference to this object so that method calls can be chained together. */ Builder modifiedAt(Instant modifiedAt); /** *

      * If defined, the Pod Identity Association is owned by an Amazon EKS Addon. *

      * * @param ownerArn * If defined, the Pod Identity Association is owned by an Amazon EKS Addon. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerArn(String ownerArn); } static final class BuilderImpl implements Builder { private String clusterName; private String namespace; private String serviceAccount; private String roleArn; private String associationArn; private String associationId; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private Instant createdAt; private Instant modifiedAt; private String ownerArn; private BuilderImpl() { } private BuilderImpl(PodIdentityAssociation model) { clusterName(model.clusterName); namespace(model.namespace); serviceAccount(model.serviceAccount); roleArn(model.roleArn); associationArn(model.associationArn); associationId(model.associationId); tags(model.tags); createdAt(model.createdAt); modifiedAt(model.modifiedAt); ownerArn(model.ownerArn); } public final String getClusterName() { return clusterName; } public final void setClusterName(String clusterName) { this.clusterName = clusterName; } @Override public final Builder clusterName(String clusterName) { this.clusterName = clusterName; return this; } public final String getNamespace() { return namespace; } public final void setNamespace(String namespace) { this.namespace = namespace; } @Override public final Builder namespace(String namespace) { this.namespace = namespace; return this; } public final String getServiceAccount() { return serviceAccount; } public final void setServiceAccount(String serviceAccount) { this.serviceAccount = serviceAccount; } @Override public final Builder serviceAccount(String serviceAccount) { this.serviceAccount = serviceAccount; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final String getAssociationArn() { return associationArn; } public final void setAssociationArn(String associationArn) { this.associationArn = associationArn; } @Override public final Builder associationArn(String associationArn) { this.associationArn = associationArn; return this; } public final String getAssociationId() { return associationId; } public final void setAssociationId(String associationId) { this.associationId = associationId; } @Override public final Builder associationId(String associationId) { this.associationId = associationId; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final Instant getModifiedAt() { return modifiedAt; } public final void setModifiedAt(Instant modifiedAt) { this.modifiedAt = modifiedAt; } @Override public final Builder modifiedAt(Instant modifiedAt) { this.modifiedAt = modifiedAt; return this; } public final String getOwnerArn() { return ownerArn; } public final void setOwnerArn(String ownerArn) { this.ownerArn = ownerArn; } @Override public final Builder ownerArn(String ownerArn) { this.ownerArn = ownerArn; return this; } @Override public PodIdentityAssociation build() { return new PodIdentityAssociation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy