Experimental
@aws-cdk/aws-apprunner-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
ImageRepository Struct
Describes a source image repository.
| Stability | Experimental |
|---|---|
| Source | lib/service.ts |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as apprunner_alpha from '@aws-cdk/aws-apprunner-alpha';
declare const secret: apprunner_alpha.Secret;
const imageRepository: apprunner_alpha.ImageRepository = {
imageIdentifier: 'imageIdentifier',
imageRepositoryType: apprunner_alpha.ImageRepositoryType.ECR_PUBLIC,
// the properties below are optional
imageConfiguration: {
environment: {
environmentKey: 'environment',
},
environmentSecrets: {
environmentSecretsKey: secret,
},
environmentVariables: {
environmentVariablesKey: 'environmentVariables',
},
port: 123,
startCommand: 'startCommand',
},
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_apprunner_alpha as apprunner_alpha
# secret: apprunner_alpha.Secret
image_repository = apprunner_alpha.ImageRepository(
image_identifier="imageIdentifier",
image_repository_type=apprunner_alpha.ImageRepositoryType.ECR_PUBLIC,
# the properties below are optional
image_configuration=apprunner_alpha.ImageConfiguration(
environment={
"environment_key": "environment"
},
environment_secrets={
"environment_secrets_key": secret
},
environment_variables={
"environment_variables_key": "environmentVariables"
},
port=123,
start_command="startCommand"
)
)
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.apprunner.alpha.*;
Secret secret;
ImageRepository imageRepository = ImageRepository.builder()
.imageIdentifier("imageIdentifier")
.imageRepositoryType(ImageRepositoryType.ECR_PUBLIC)
// the properties below are optional
.imageConfiguration(ImageConfiguration.builder()
.environment(Map.of(
"environmentKey", "environment"))
.environmentSecrets(Map.of(
"environmentSecretsKey", secret))
.environmentVariables(Map.of(
"environmentVariablesKey", "environmentVariables"))
.port(123)
.startCommand("startCommand")
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.AppRunner.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppRunner.Alpha;
Secret secret;
var imageRepository = new ImageRepository {
ImageIdentifier = "imageIdentifier",
ImageRepositoryType = ImageRepositoryType.ECR_PUBLIC,
// the properties below are optional
ImageConfiguration = new ImageConfiguration {
Environment = new Dictionary<string, string> {
{ "environmentKey", "environment" }
},
EnvironmentSecrets = new Dictionary<string, Secret> {
{ "environmentSecretsKey", secret }
},
EnvironmentVariables = new Dictionary<string, string> {
{ "environmentVariablesKey", "environmentVariables" }
},
Port = 123,
StartCommand = "startCommand"
}
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdkapprunneralpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import apprunner_alpha "github.com/aws/aws-cdk-go/awscdkapprunneralpha"
var secret Secret
imageRepository := &ImageRepository{
ImageIdentifier: jsii.String("imageIdentifier"),
ImageRepositoryType: apprunner_alpha.ImageRepositoryType_ECR_PUBLIC,
// the properties below are optional
ImageConfiguration: &ImageConfiguration{
Environment: map[string]*string{
"environmentKey": jsii.String("environment"),
},
EnvironmentSecrets: map[string]Secret{
"environmentSecretsKey": secret,
},
EnvironmentVariables: map[string]*string{
"environmentVariablesKey": jsii.String("environmentVariables"),
},
Port: jsii.Number(123),
StartCommand: jsii.String("startCommand"),
},
}
Properties
imageConfigurationoptionalImageConfigurationimage_configurationoptionalImageConfigurationimageConfigurationoptionalImageConfigurationImageConfigurationoptionalImageConfigurationImageConfigurationoptionalImageConfiguration #Configuration for running the identified image.
Default: no image configuration will be passed. The default port will be 8080.
imageIdentifierstringimage_identifierstrimageIdentifierStringImageIdentifierstringImageIdentifier*string required #The identifier of the image.
For ECR_PUBLIC imageRepositoryType, the identifier domain should always be public.ecr.aws. For ECR, the pattern should be ([0-9]{12}.dkr.ecr.[a-z\-]+-[0-9]{1}.amazonaws.com\/.*).
imageRepositoryTypeImageRepositoryTypeimage_repository_typeImageRepositoryTypeimageRepositoryTypeImageRepositoryTypeImageRepositoryTypeImageRepositoryTypeImageRepositoryTypeImageRepositoryType required #The type of the image repository.
This reflects the repository provider and whether the repository is private or public.