Class Service
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.apprunner.alpha.Service
- All Implemented Interfaces:
IEnvironmentAware,IResource,IService,IGrantable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-12T17:54:26.553Z")
@Stability(Experimental)
public class Service
extends Resource
implements IService, IGrantable
(experimental) The App Runner Service.
Example:
import software.amazon.awscdk.services.iam.*;
Service service = Service.Builder.create(this, "Service")
.source(Source.fromEcrPublic(EcrPublicProps.builder()
.imageConfiguration(ImageConfiguration.builder().port(8000).build())
.imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
.build()))
.build();
service.addToRolePolicy(PolicyStatement.Builder.create()
.effect(Effect.ALLOW)
.actions(List.of("s3:GetObject"))
.resources(List.of("*"))
.build());
-
Nested Class Summary
Nested ClassesNested 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.services.iam.IGrantable
IGrantable.Jsii$Default, IGrantable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.apprunner.alpha.IService
IService.Jsii$Default, IService.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedService(software.amazon.jsii.JsiiObjectRef objRef) Service(software.constructs.Construct scope, String id, ServiceProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEnvironmentVariable(String name, String value) (experimental) This method adds an environment variable to the App Runner service.void(experimental) This method adds a secret as environment variable to the App Runner service.voidaddToRolePolicy(PolicyStatement statement) (experimental) Adds a statement to the instance role.static IServicefromServiceAttributes(software.constructs.Construct scope, String id, ServiceAttributes attrs) (experimental) Import from service attributes.static IServicefromServiceName(software.constructs.Construct scope, String id, String serviceName) (experimental) Import from service name.Deprecated.use environmentVariables.(experimental) The principal to grant permissions to.(experimental) The ARN of the Service.(experimental) The ID of the Service.(experimental) The name of the service.(experimental) The status of the Service.(experimental) The URL of the Service.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods 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.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
Service
protected Service(software.amazon.jsii.JsiiObjectRef objRef) -
Service
protected Service(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Service
@Stability(Experimental) public Service(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ServiceProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromServiceAttributes
@Stability(Experimental) @NotNull public static IService fromServiceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ServiceAttributes attrs) (experimental) Import from service attributes.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
fromServiceName
@Stability(Experimental) @NotNull public static IService fromServiceName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String serviceName) (experimental) Import from service name.- Parameters:
scope- This parameter is required.id- This parameter is required.serviceName- This parameter is required.
-
addEnvironmentVariable
@Stability(Experimental) public void addEnvironmentVariable(@NotNull String name, @NotNull String value) (experimental) This method adds an environment variable to the App Runner service.- Parameters:
name- This parameter is required.value- This parameter is required.
-
addSecret
(experimental) This method adds a secret as environment variable to the App Runner service.- Parameters:
name- This parameter is required.secret- This parameter is required.
-
addToRolePolicy
(experimental) Adds a statement to the instance role.- Parameters:
statement- This parameter is required.
-
getEnvironment
Deprecated.use environmentVariables.(deprecated) Environment variables for this service. -
getGrantPrincipal
(experimental) The principal to grant permissions to.- Specified by:
getGrantPrincipalin interfaceIGrantable
-
getServiceArn
(experimental) The ARN of the Service.- Specified by:
getServiceArnin interfaceIService
-
getServiceId
(experimental) The ID of the Service. -
getServiceName
(experimental) The name of the service.- Specified by:
getServiceNamein interfaceIService
-
getServiceStatus
(experimental) The status of the Service. -
getServiceUrl
(experimental) The URL of the Service.
-