ServiceProps Struct
Properties of the AppRunner Service.
Example
import * as iam from 'aws-cdk-lib/aws-iam';
const service = new apprunner.Service(this, 'Service', {
source: apprunner.Source.fromEcrPublic({
imageConfiguration: { port: 8000 },
imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
}),
});
service.addToRolePolicy(new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['s3:GetObject'],
resources: ['*'],
}))
Properties
accessRoleIRoleaccess_roleIRoleaccessRoleIRoleAccessRoleIRoleAccessRoleIRole= generate a new access role.#It's required for ECR image repositories (but not for ECR Public repositories).
The role must be assumable by the 'build.apprunner.amazonaws.com' service principal.
autoDeploymentsEnabledbooleanauto_deployments_enabledboolautoDeploymentsEnabledBooleanAutoDeploymentsEnabledboolAutoDeploymentsEnabled*bool= no value will be passed.#notes
If true, continuous integration from the source repository is enabled for the App Runner service. Each repository change (including any source code commit or new image version) starts a deployment. By default, App Runner sets to false for a source image that uses an ECR Public repository or an ECR repository that's in an AWS account other than the one that the service is in. App Runner sets to true in all other cases (which currently include a source code repository or a source image using a same-account ECR repository).
autoScalingConfigurationIAutoScalingConfigurationauto_scaling_configurationIAutoScalingConfigurationautoScalingConfigurationIAutoScalingConfigurationAutoScalingConfigurationIAutoScalingConfigurationAutoScalingConfigurationIAutoScalingConfiguration= the latest revision of a default…#A default configuration is either the AWS recommended configuration, or the configuration you set as the default.
default
Default: the latest revision of a default auto scaling configuration is used.
healthCheckHealthCheckhealth_checkHealthCheckhealthCheckHealthCheckHealthCheckHealthCheckHealthCheckHealthCheck= no health check configuration#You can specify it by static methods HealthCheck.http or HealthCheck.tcp.
instanceRoleIRoleinstance_roleIRoleinstanceRoleIRoleInstanceRoleIRoleInstanceRoleIRole= generate a new instance role.#These are permissions that your code needs when it calls any AWS APIs.
The role must be assumable by the 'tasks.apprunner.amazonaws.com' service principal.
ipAddressTypeIpAddressTypeip_address_typeIpAddressTypeipAddressTypeIpAddressTypeIpAddressTypeIpAddressTypeIpAddressTypeIpAddressType= IpAddressType.IPV4#isPubliclyAccessiblebooleanis_publicly_accessibleboolisPubliclyAccessibleBooleanIsPubliclyAccessibleboolIsPubliclyAccessible*bool= true#If you use VpcIngressConnection, you must set this property to false.
observabilityConfigurationIObservabilityConfigurationobservability_configurationIObservabilityConfigurationobservabilityConfigurationIObservabilityConfigurationObservabilityConfigurationIObservabilityConfigurationObservabilityConfigurationIObservabilityConfiguration= no observability configuration r…#default
Default: no observability configuration resource is associated with the service.
serviceNamestringservice_namestrserviceNameStringServiceNamestringServiceName*string= auto-generated if undefined.#vpcConnectorIVpcConnectorvpc_connectorIVpcConnectorvpcConnectorIVpcConnectorVpcConnectorIVpcConnectorVpcConnectorIVpcConnector= no VPC connector, uses the DEFAU…#default
Default: no VPC connector, uses the DEFAULT egress type instead