Skip to content
v2.278.0

EcrDockerCredentialOptions Struct ​

Options for defining access for a Docker Credential composed of ECR repos.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iam as iam } from 'aws-cdk-lib';
import { pipelines } from 'aws-cdk-lib';

declare const role: iam.Role;
const ecrDockerCredentialOptions: pipelines.EcrDockerCredentialOptions = {
  assumeRole: role,
  usages: [pipelines.DockerCredentialUsage.SYNTH],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_iam as iam
from aws_cdk import pipelines

# role: iam.Role

ecr_docker_credential_options = pipelines.EcrDockerCredentialOptions(
    assume_role=role,
    usages=[pipelines.DockerCredentialUsage.SYNTH]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.pipelines.*;

Role role;

EcrDockerCredentialOptions ecrDockerCredentialOptions = EcrDockerCredentialOptions.builder()
        .assumeRole(role)
        .usages(List.of(DockerCredentialUsage.SYNTH))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.Pipelines;

Role role;

var ecrDockerCredentialOptions = new EcrDockerCredentialOptions {
    AssumeRole = role,
    Usages = new [] { DockerCredentialUsage.SYNTH }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var role Role

ecrDockerCredentialOptions := &EcrDockerCredentialOptions{
	AssumeRole: role,
	Usages: []DockerCredentialUsage{
		awscdk.Pipelines.DockerCredentialUsage_SYNTH,
	},
}

Properties ​

assumeRoleoptionalIRoleassume_roleoptionalIRoleassumeRoleoptionalIRoleAssumeRoleoptionalIRoleAssumeRoleoptionalIRole #
An IAM role to assume prior to accessing the secret.

Default: none. The current execution role will be used.

usagesoptionalDockerCredentialUsage[]usagesoptionaltyping.List[DockerCredentialUsage]usagesoptionalList<DockerCredentialUsage>UsagesoptionalDockerCredentialUsage[]Usagesoptional*[]DockerCredentialUsage #
Defines which stages of the pipeline should be granted access to these credentials.

Default: all relevant stages (synth, self-update, asset publishing) are granted access.