@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:42.937Z") @Stability(value=Stable) public abstract class DockerCredential extends software.amazon.jsii.JsiiObject
Example:
ISecret dockerHubSecret = Secret.fromSecretCompleteArn(this, "DHSecret", "arn:aws:...");
ISecret customRegSecret = Secret.fromSecretCompleteArn(this, "CRSecret", "arn:aws:...");
IRepository repo1 = Repository.fromRepositoryArn(this, "Repo", "arn:aws:ecr:eu-west-1:0123456789012:repository/Repo1");
IRepository repo2 = Repository.fromRepositoryArn(this, "Repo", "arn:aws:ecr:eu-west-1:0123456789012:repository/Repo2");
CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline")
.dockerCredentials(List.of(DockerCredential.dockerHub(dockerHubSecret), DockerCredential.customRegistry("dockerregistry.example.com", customRegSecret), DockerCredential.ecr(List.of(repo1, repo2))))
.synth(ShellStep.Builder.create("Synth")
.input(CodePipelineSource.connection("my-org/my-app", "main", ConnectionSourceOptions.builder()
.connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41")
.build()))
.commands(List.of("npm ci", "npm run build", "npx cdk synth"))
.build())
.build();
| Modifier | Constructor and Description |
|---|---|
protected |
DockerCredential() |
protected |
DockerCredential(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
DockerCredential(software.amazon.jsii.JsiiObjectRef objRef) |
protected |
DockerCredential(List<DockerCredentialUsage> usages) |
| Modifier and Type | Method and Description |
|---|---|
static DockerCredential |
customRegistry(String registryDomain,
ISecret secret)
Creates a DockerCredential for a registry, based on its domain name (e.g., 'www.example.com').
|
static DockerCredential |
customRegistry(String registryDomain,
ISecret secret,
ExternalDockerCredentialOptions opts)
Creates a DockerCredential for a registry, based on its domain name (e.g., 'www.example.com').
|
static DockerCredential |
dockerHub(ISecret secret)
Creates a DockerCredential for DockerHub.
|
static DockerCredential |
dockerHub(ISecret secret,
ExternalDockerCredentialOptions opts)
Creates a DockerCredential for DockerHub.
|
static DockerCredential |
ecr(List<? extends IRepository> repositories)
Creates a DockerCredential for one or more ECR repositories.
|
static DockerCredential |
ecr(List<? extends IRepository> repositories,
EcrDockerCredentialOptions opts)
Creates a DockerCredential for one or more ECR repositories.
|
protected List<DockerCredentialUsage> |
getUsages() |
abstract void |
grantRead(IGrantable grantee,
DockerCredentialUsage usage)
Grant read-only access to the registry credentials.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected DockerCredential(software.amazon.jsii.JsiiObjectRef objRef)
protected DockerCredential(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
protected DockerCredential(@Nullable
List<DockerCredentialUsage> usages)
usages - @Stability(value=Stable) protected DockerCredential()
@Stability(value=Stable) @NotNull public static DockerCredential customRegistry(@NotNull String registryDomain, @NotNull ISecret secret, @Nullable ExternalDockerCredentialOptions opts)
registryDomain - This parameter is required.secret - This parameter is required.opts - @Stability(value=Stable) @NotNull public static DockerCredential customRegistry(@NotNull String registryDomain, @NotNull ISecret secret)
registryDomain - This parameter is required.secret - This parameter is required.@Stability(value=Stable) @NotNull public static DockerCredential dockerHub(@NotNull ISecret secret, @Nullable ExternalDockerCredentialOptions opts)
Convenience method for customRegistry('https://index.docker.io/v1/', opts).
secret - This parameter is required.opts - @Stability(value=Stable) @NotNull public static DockerCredential dockerHub(@NotNull ISecret secret)
Convenience method for customRegistry('https://index.docker.io/v1/', opts).
secret - This parameter is required.@Stability(value=Stable) @NotNull public static DockerCredential ecr(@NotNull List<? extends IRepository> repositories, @Nullable EcrDockerCredentialOptions opts)
NOTE - All ECR repositories in the same account and region share a domain name (e.g., 0123456789012.dkr.ecr.eu-west-1.amazonaws.com), and can only have one associated set of credentials (and DockerCredential). Attempting to associate one set of credentials with one ECR repo and another with another ECR repo in the same account and region will result in failures when using these credentials in the pipeline.
repositories - This parameter is required.opts - @Stability(value=Stable) @NotNull public static DockerCredential ecr(@NotNull List<? extends IRepository> repositories)
NOTE - All ECR repositories in the same account and region share a domain name (e.g., 0123456789012.dkr.ecr.eu-west-1.amazonaws.com), and can only have one associated set of credentials (and DockerCredential). Attempting to associate one set of credentials with one ECR repo and another with another ECR repo in the same account and region will result in failures when using these credentials in the pipeline.
repositories - This parameter is required.@Stability(value=Stable)
public abstract void grantRead(@NotNull
IGrantable grantee,
@NotNull
DockerCredentialUsage usage)
This grants read access to any secrets, and pull access to any repositories.
grantee - This parameter is required.usage - This parameter is required.@Stability(value=Stable) @Nullable protected List<DockerCredentialUsage> getUsages()
Copyright © 2022. All rights reserved.