public ContainerDefinition withCredentialSpecs(java.util.Collection<String> credentialSpecs) {
        setCredentialSpecs(credentialSpecs);
        return this;
    }
<p>
A list of ARNs in SSM or Amazon S3 to a credential spec (<code>CredSpec</code>) file that configures the
container for Active Directory authentication. We recommend that you use this parameter instead of the
<code>dockerSecurityOptions</code>. The maximum number of ARNs is 1.
</p>
<p>
There are two formats for each ARN.
</p>
<dl>
<dt>credentialspecdomainless:MyARN</dt>
<dd>
<p>
You use <code>credentialspecdomainless:MyARN</code> to provide a <code>CredSpec</code> with an additional section
for a secret in Secrets Manager. You provide the login credentials to the domain in the secret.
</p>
<p>
Each task that runs on any container instance can join different domains.
</p>
<p>
You can use this format without joining the container instance to a domain.
</p>
</dd>
<dt>credentialspec:MyARN</dt>
<dd>
<p>
You use <code>credentialspec:MyARN</code> to provide a <code>CredSpec</code> for a single domain.
</p>
<p>
You must join the container instance to the domain before you start any tasks that use this task definition.
</p>
</dd>
</dl>
<p>
In both formats, replace <code>MyARN</code> with the ARN in SSM or Amazon S3.
</p>
<p>
If you provide a <code>credentialspecdomainless:MyARN</code>, the <code>credspec</code> must provide a ARN in
Secrets Manager for a secret containing the username, password, and the domain to connect to. For better
security, the instance isn't joined to the domain for domainless authentication. Other applications on the
instance can't use the domainless credentials. You can use this parameter to run tasks on the same instance, even
it the tasks need to join different domains. For more information, see <a
href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html">Using gMSAs for Windows
Containers</a> and <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html">Using
gMSAs for Linux Containers</a>.
</p>

@param credentialSpecs
       A list of ARNs in SSM or Amazon S3 to a credential spec (<code>CredSpec</code>) file that configures the
       container for Active Directory authentication. We recommend that you use this parameter instead of the
       <code>dockerSecurityOptions</code>. The maximum number of ARNs is 1.</p>
       <p>
       There are two formats for each ARN.
       </p>
       <dl>
       <dt>credentialspecdomainless:MyARN</dt>
       <dd>
       <p>
       You use <code>credentialspecdomainless:MyARN</code> to provide a <code>CredSpec</code> with an additional
       section for a secret in Secrets Manager. You provide the login credentials to the domain in the secret.
       </p>
       <p>
       Each task that runs on any container instance can join different domains.
       </p>
       <p>
       You can use this format without joining the container instance to a domain.
       </p>
       </dd>
       <dt>credentialspec:MyARN</dt>
       <dd>
       <p>
       You use <code>credentialspec:MyARN</code> to provide a <code>CredSpec</code> for a single domain.
       </p>
       <p>
       You must join the container instance to the domain before you start any tasks that use this task
       definition.
       </p>
       </dd>
       </dl>
       <p>
       In both formats, replace <code>MyARN</code> with the ARN in SSM or Amazon S3.
       </p>
       <p>
       If you provide a <code>credentialspecdomainless:MyARN</code>, the <code>credspec</code> must provide a ARN
       in Secrets Manager for a secret containing the username, password, and the domain to connect to. For
       better security, the instance isn't joined to the domain for domainless authentication. Other applications
       on the instance can't use the domainless credentials. You can use this parameter to run tasks on the same
       instance, even it the tasks need to join different domains. For more information, see <a
       href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html">Using gMSAs for
       Windows Containers</a> and <a
       href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/linux-gmsa.html">Using gMSAs for Linux
       Containers</a>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/ContainerDefinition.java