DockerCredentialUsage Enum
Defines which stages of a pipeline require the specified credentials.
| Source | pipelines/lib/docker-credentials.ts |
|---|
Example
ts
const dockerHubSecret = secretsmanager.Secret.fromSecretCompleteArn(
this,
'DHSecret',
'arn:aws:...'
);
// Only the image asset publishing actions will be granted read access to the secret.
const creds = pipelines.DockerCredential.dockerHub(dockerHubSecret, {
usages: [pipelines.DockerCredentialUsage.ASSET_PUBLISHING],
});
python
docker_hub_secret = secretsmanager.Secret.from_secret_complete_arn(self, "DHSecret", "arn:aws:...")
# Only the image asset publishing actions will be granted read access to the secret.
creds = pipelines.DockerCredential.docker_hub(docker_hub_secret,
usages=[pipelines.DockerCredentialUsage.ASSET_PUBLISHING]
)
java
ISecret dockerHubSecret = Secret.fromSecretCompleteArn(this, "DHSecret", "arn:aws:...");
// Only the image asset publishing actions will be granted read access to the secret.
DockerCredential creds = DockerCredential.dockerHub(dockerHubSecret, ExternalDockerCredentialOptions.builder()
.usages(List.of(DockerCredentialUsage.ASSET_PUBLISHING))
.build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var dockerHubSecret = Secret.FromSecretCompleteArn(this, "DHSecret", "arn:aws:...");
// Only the image asset publishing actions will be granted read access to the secret.
var creds = DockerCredential.DockerHub(dockerHubSecret, new ExternalDockerCredentialOptions {
Usages = new [] { DockerCredentialUsage.ASSET_PUBLISHING }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
dockerHubSecret := secretsmanager.Secret_FromSecretCompleteArn(this, jsii.String("DHSecret"), jsii.String("arn:aws:..."))
// Only the image asset publishing actions will be granted read access to the secret.
creds := pipelines.DockerCredential_DockerHub(dockerHubSecret, &ExternalDockerCredentialOptions{
Usages: []DockerCredentialUsage{
pipelines.DockerCredentialUsage_ASSET_PUBLISHING,
},
})
Members
| Member | Description |
|---|---|
SYNTH | Synth/Build. |
SELF_UPDATE | Self-update. |
ASSET_PUBLISHING | Asset publishing. |
Referenced by
DockerCredential.usagesusagesusagesUsagesUsagesEcrDockerCredentialOptions.usagesusagesusagesUsagesUsagesExternalDockerCredentialOptions.usagesusagesusagesUsagesUsages