Class Service
(experimental) The App Runner Service.
Inherited Members
Namespace: Amazon.CDK.AWS.AppRunner.Alpha
Assembly: Amazon.CDK.AWS.AppRunner.Alpha.dll
Syntax (csharp)
public class Service : Resource, IResource, IGrantable
Syntax (vb)
Public Class Service
Inherits Resource
Implements IResource, IGrantable
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.IAM;
var service = new Service(this, "Service", new ServiceProps {
Source = Source.FromEcrPublic(new EcrPublicProps {
ImageConfiguration = new ImageConfiguration { Port = 8000 },
ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
})
});
service.AddToRolePolicy(new PolicyStatement(new PolicyStatementProps {
Effect = Effect.ALLOW,
Actions = new [] { "s3:GetObject" },
Resources = new [] { "*" }
}));
Synopsis
Constructors
Service(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Service(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Service(Construct, String, IServiceProps) |
Properties
Environment | (deprecated) Environment variables for this service. |
GrantPrincipal | (experimental) The principal to grant permissions to. |
ServiceArn | (experimental) The ARN of the Service. |
ServiceId | (experimental) The ID of the Service. |
ServiceName | (experimental) The name of the service. |
ServiceStatus | (experimental) The status of the Service. |
ServiceUrl | (experimental) The URL of the Service. |
Methods
AddEnvironmentVariable(String, String) | (experimental) This method adds an environment variable to the App Runner service. |
AddSecret(String, Secret) | (experimental) This method adds a secret as environment variable to the App Runner service. |
AddToRolePolicy(PolicyStatement) | (experimental) Adds a statement to the instance role. |
FromServiceAttributes(Construct, String, IServiceAttributes) | (experimental) Import from service attributes. |
FromServiceName(Construct, String, String) | (experimental) Import from service name. |
Constructors
Service(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Service(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Service(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Service(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Service(Construct, String, IServiceProps)
public Service(Construct scope, string id, IServiceProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IServiceProps
Remarks
Stability: Experimental
Properties
Environment
(deprecated) Environment variables for this service.
public virtual IDictionary<string, string> Environment { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Stability: Deprecated
GrantPrincipal
(experimental) The principal to grant permissions to.
public virtual IPrincipal GrantPrincipal { get; }
Property Value
Remarks
Stability: Experimental
ServiceArn
(experimental) The ARN of the Service.
public virtual string ServiceArn { get; }
Property Value
System.String
Remarks
Stability: Experimental
Attribute: true
ServiceId
(experimental) The ID of the Service.
public virtual string ServiceId { get; }
Property Value
System.String
Remarks
Stability: Experimental
Attribute: true
ServiceName
(experimental) The name of the service.
public virtual string ServiceName { get; }
Property Value
System.String
Remarks
Stability: Experimental
ServiceStatus
(experimental) The status of the Service.
public virtual string ServiceStatus { get; }
Property Value
System.String
Remarks
Stability: Experimental
Attribute: true
ServiceUrl
(experimental) The URL of the Service.
public virtual string ServiceUrl { get; }
Property Value
System.String
Remarks
Stability: Experimental
Attribute: true
Methods
AddEnvironmentVariable(String, String)
(experimental) This method adds an environment variable to the App Runner service.
public virtual void AddEnvironmentVariable(string name, string value)
Parameters
- name System.String
- value System.String
Remarks
Stability: Experimental
AddSecret(String, Secret)
(experimental) This method adds a secret as environment variable to the App Runner service.
public virtual void AddSecret(string name, Secret secret)
Parameters
- name System.String
- secret Secret
Remarks
Stability: Experimental
AddToRolePolicy(PolicyStatement)
(experimental) Adds a statement to the instance role.
public virtual void AddToRolePolicy(PolicyStatement statement)
Parameters
- statement PolicyStatement
Remarks
Stability: Experimental
FromServiceAttributes(Construct, String, IServiceAttributes)
(experimental) Import from service attributes.
public static IService FromServiceAttributes(Construct scope, string id, IServiceAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IServiceAttributes
Returns
Remarks
Stability: Experimental
FromServiceName(Construct, String, String)
(experimental) Import from service name.
public static IService FromServiceName(Construct scope, string id, string serviceName)
Parameters
- scope Constructs.Construct
- id System.String
- serviceName System.String
Returns
Remarks
Stability: Experimental