Class CfnService
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.apprunner.CfnService
- All Implemented Interfaces:
IInspectable,ITaggable,IServiceRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:32.418Z")
@Stability(Stable)
public class CfnService
extends CfnResource
implements IInspectable, IServiceRef, ITaggable
Specify an AWS App Runner service by using the
AWS::AppRunner::Service resource in an AWS CloudFormation template.
The AWS::AppRunner::Service resource is an AWS App Runner resource type that specifies an App Runner service.
Example:
// 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.*;
CfnService cfnService = CfnService.Builder.create(this, "MyCfnService")
.sourceConfiguration(SourceConfigurationProperty.builder()
.authenticationConfiguration(AuthenticationConfigurationProperty.builder()
.accessRoleArn("accessRoleArn")
.connectionArn("connectionArn")
.build())
.autoDeploymentsEnabled(false)
.codeRepository(CodeRepositoryProperty.builder()
.repositoryUrl("repositoryUrl")
.sourceCodeVersion(SourceCodeVersionProperty.builder()
.type("type")
.value("value")
.build())
// the properties below are optional
.codeConfiguration(CodeConfigurationProperty.builder()
.configurationSource("configurationSource")
// the properties below are optional
.codeConfigurationValues(CodeConfigurationValuesProperty.builder()
.runtime("runtime")
// the properties below are optional
.buildCommand("buildCommand")
.port("port")
.runtimeEnvironmentSecrets(List.of(KeyValuePairProperty.builder()
.name("name")
.value("value")
.build()))
.runtimeEnvironmentVariables(List.of(KeyValuePairProperty.builder()
.name("name")
.value("value")
.build()))
.startCommand("startCommand")
.build())
.build())
.sourceDirectory("sourceDirectory")
.build())
.imageRepository(ImageRepositoryProperty.builder()
.imageIdentifier("imageIdentifier")
.imageRepositoryType("imageRepositoryType")
// the properties below are optional
.imageConfiguration(ImageConfigurationProperty.builder()
.port("port")
.runtimeEnvironmentSecrets(List.of(KeyValuePairProperty.builder()
.name("name")
.value("value")
.build()))
.runtimeEnvironmentVariables(List.of(KeyValuePairProperty.builder()
.name("name")
.value("value")
.build()))
.startCommand("startCommand")
.build())
.build())
.build())
// the properties below are optional
.autoScalingConfigurationArn("autoScalingConfigurationArn")
.encryptionConfiguration(EncryptionConfigurationProperty.builder()
.kmsKey("kmsKey")
.build())
.healthCheckConfiguration(HealthCheckConfigurationProperty.builder()
.healthyThreshold(123)
.interval(123)
.path("path")
.protocol("protocol")
.timeout(123)
.unhealthyThreshold(123)
.build())
.instanceConfiguration(InstanceConfigurationProperty.builder()
.cpu("cpu")
.instanceRoleArn("instanceRoleArn")
.memory("memory")
.build())
.networkConfiguration(NetworkConfigurationProperty.builder()
.egressConfiguration(EgressConfigurationProperty.builder()
.egressType("egressType")
// the properties below are optional
.vpcConnectorArn("vpcConnectorArn")
.build())
.ingressConfiguration(IngressConfigurationProperty.builder()
.isPubliclyAccessible(false)
.build())
.ipAddressType("ipAddressType")
.build())
.observabilityConfiguration(ServiceObservabilityConfigurationProperty.builder()
.observabilityEnabled(false)
// the properties below are optional
.observabilityConfigurationArn("observabilityConfigurationArn")
.build())
.serviceName("serviceName")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDescribes resources needed to authenticate access to some source repositories.static final classA fluent builder forCfnService.static interfaceDescribes the configuration that AWS App Runner uses to build and run an App Runner service from a source code repository.static interfaceDescribes the basic configuration needed for building and running an AWS App Runner service.static interfaceDescribes a source code repository.static interfaceDescribes configuration settings related to outbound network traffic of an AWS App Runner service.static interfaceDescribes a custom encryption key that AWS App Runner uses to encrypt copies of the source repository and service logs.static interfaceDescribes the settings for the health check that AWS App Runner performs to monitor the health of a service.static interfaceDescribes the configuration that AWS App Runner uses to run an App Runner service using an image pulled from a source image repository.static interfaceDescribes a source image repository.static interfaceNetwork configuration settings for inbound network traffic.static interfaceDescribes the runtime configuration of an AWS App Runner service instance (scaling unit).static interfaceDescribes a key-value pair, which is a string-to-string mapping.static interfaceDescribes configuration settings related to network traffic of an AWS App Runner service.static interfaceDescribes the observability configuration of an AWS App Runner service.static interfaceIdentifies a version of code that AWS App Runner refers to within a source code repository.static interfaceDescribes the source deployed to an AWS App Runner service.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.apprunner.IServiceRef
IServiceRef.Jsii$Default, IServiceRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnService(software.amazon.jsii.JsiiObjectRef objRef) CfnService(software.constructs.Construct scope, String id, CfnServiceProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe Amazon Resource Name (ARN) of this service.An ID that App Runner generated for this service.A subdomain URL that App Runner generated for this service.The current state of the App Runner service.The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service.An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs.The settings for the health check that AWS App Runner performs to monitor the health of the App Runner service.The runtime configuration of instances (scaling units) of your service.Configuration settings related to network traffic of the web application that the App Runner service runs.The observability configuration of your service.A name for the App Runner service.A reference to a Service resource.The source to deploy to the App Runner service.getTags()Tag Manager which manages the tags for this resource.An optional list of metadata items that you can associate with the App Runner service resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidThe Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service.voidAn optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs.voidAn optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs.voidThe settings for the health check that AWS App Runner performs to monitor the health of the App Runner service.voidThe settings for the health check that AWS App Runner performs to monitor the health of the App Runner service.voidThe runtime configuration of instances (scaling units) of your service.voidThe runtime configuration of instances (scaling units) of your service.voidConfiguration settings related to network traffic of the web application that the App Runner service runs.voidConfiguration settings related to network traffic of the web application that the App Runner service runs.voidThe observability configuration of your service.voidThe observability configuration of your service.voidsetServiceName(String value) A name for the App Runner service.voidThe source to deploy to the App Runner service.voidThe source to deploy to the App Runner service.voidsetTagsRaw(List<CfnTag> value) An optional list of metadata items that you can associate with the App Runner service resource.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnService
protected CfnService(software.amazon.jsii.JsiiObjectRef objRef) -
CfnService
protected CfnService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnService
@Stability(Stable) public CfnService(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnServiceProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrServiceArn
The Amazon Resource Name (ARN) of this service. -
getAttrServiceId
An ID that App Runner generated for this service.It's unique within the AWS Region .
-
getAttrServiceUrl
A subdomain URL that App Runner generated for this service.You can use this URL to access your service web application.
-
getAttrStatus
The current state of the App Runner service. These particular values mean the following.CREATE_FAILED– The service failed to create. The failed service isn't usable, and still counts towards your service quota. To troubleshoot this failure, read the failure events and logs, change any parameters that need to be fixed, and rebuild your service usingUpdateService.DELETE_FAILED– The service failed to delete and can't be successfully recovered. Retry the service deletion call to ensure that all related resources are removed.
-
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getServiceRef
A reference to a Service resource.- Specified by:
getServiceRefin interfaceIServiceRef
-
getTags
Tag Manager which manages the tags for this resource. -
getSourceConfiguration
The source to deploy to the App Runner service.Returns union: either
IResolvableorCfnService.SourceConfigurationProperty -
setSourceConfiguration
The source to deploy to the App Runner service. -
setSourceConfiguration
@Stability(Stable) public void setSourceConfiguration(@NotNull CfnService.SourceConfigurationProperty value) The source to deploy to the App Runner service. -
getAutoScalingConfigurationArn
The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. -
setAutoScalingConfigurationArn
The Amazon Resource Name (ARN) of an App Runner automatic scaling configuration resource that you want to associate with your service. -
getEncryptionConfiguration
An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs.Returns union: either
IResolvableorCfnService.EncryptionConfigurationProperty -
setEncryptionConfiguration
An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. -
setEncryptionConfiguration
@Stability(Stable) public void setEncryptionConfiguration(@Nullable CfnService.EncryptionConfigurationProperty value) An optional custom encryption key that App Runner uses to encrypt the copy of your source repository that it maintains and your service logs. -
getHealthCheckConfiguration
The settings for the health check that AWS App Runner performs to monitor the health of the App Runner service.Returns union: either
IResolvableorCfnService.HealthCheckConfigurationProperty -
setHealthCheckConfiguration
The settings for the health check that AWS App Runner performs to monitor the health of the App Runner service. -
setHealthCheckConfiguration
@Stability(Stable) public void setHealthCheckConfiguration(@Nullable CfnService.HealthCheckConfigurationProperty value) The settings for the health check that AWS App Runner performs to monitor the health of the App Runner service. -
getInstanceConfiguration
The runtime configuration of instances (scaling units) of your service.Returns union: either
IResolvableorCfnService.InstanceConfigurationProperty -
setInstanceConfiguration
The runtime configuration of instances (scaling units) of your service. -
setInstanceConfiguration
@Stability(Stable) public void setInstanceConfiguration(@Nullable CfnService.InstanceConfigurationProperty value) The runtime configuration of instances (scaling units) of your service. -
getNetworkConfiguration
Configuration settings related to network traffic of the web application that the App Runner service runs.Returns union: either
IResolvableorCfnService.NetworkConfigurationProperty -
setNetworkConfiguration
Configuration settings related to network traffic of the web application that the App Runner service runs. -
setNetworkConfiguration
@Stability(Stable) public void setNetworkConfiguration(@Nullable CfnService.NetworkConfigurationProperty value) Configuration settings related to network traffic of the web application that the App Runner service runs. -
getObservabilityConfiguration
The observability configuration of your service.Returns union: either
IResolvableorCfnService.ServiceObservabilityConfigurationProperty -
setObservabilityConfiguration
The observability configuration of your service. -
setObservabilityConfiguration
@Stability(Stable) public void setObservabilityConfiguration(@Nullable CfnService.ServiceObservabilityConfigurationProperty value) The observability configuration of your service. -
getServiceName
A name for the App Runner service. -
setServiceName
A name for the App Runner service. -
getTagsRaw
An optional list of metadata items that you can associate with the App Runner service resource. -
setTagsRaw
An optional list of metadata items that you can associate with the App Runner service resource.
-