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:
IResource
,IService
,IGrantable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.109.0 (build c221850)",
date="2025-03-14T03:25:07.518Z")
@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.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IGrantable
IGrantable.Jsii$Default, IGrantable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.apprunner.alpha.IService
IService.Jsii$Default, IService.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Service
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
Service
(software.amazon.jsii.JsiiObjectRef objRef) Service
(software.constructs.Construct scope, String id, ServiceProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnvironmentVariable
(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.void
addToRolePolicy
(PolicyStatement statement) (experimental) Adds a statement to the instance role.static IService
fromServiceAttributes
(software.constructs.Construct scope, String id, ServiceAttributes attrs) (experimental) Import from service attributes.static IService
fromServiceName
(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, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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:
getGrantPrincipal
in interfaceIGrantable
-
getServiceArn
(experimental) The ARN of the Service.- Specified by:
getServiceArn
in interfaceIService
-
getServiceId
(experimental) The ID of the Service. -
getServiceName
(experimental) The name of the service.- Specified by:
getServiceName
in interfaceIService
-
getServiceStatus
(experimental) The status of the Service. -
getServiceUrl
(experimental) The URL of the Service.
-