Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang
Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang
Create Service Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Service(name: string, args: ServiceArgs, opts?: ComponentResourceOptions);@overload
def Service(resource_name: str,
args: ServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Service(resource_name: str,
opts: Optional[ResourceOptions] = None,
image: Optional[str] = None,
project_name: Optional[str] = None,
policies: Optional[Sequence[str]] = None,
command: Optional[Sequence[str]] = None,
depends_on: Optional[Mapping[str, _compose.ServiceDependencyArgs]] = None,
deploy: Optional[_compose.DeployConfigArgs] = None,
domain_name: Optional[str] = None,
entrypoint: Optional[Sequence[str]] = None,
environment: Optional[Mapping[str, str]] = None,
aws: Optional[_aws.SharedInfraArgs] = None,
ports: Optional[Sequence[_compose.ServicePortConfigArgs]] = None,
platform: Optional[str] = None,
container_name: Optional[str] = None,
autoscaling: Optional[bool] = None,
health_check: Optional[_compose.HealthCheckConfigArgs] = None,
secrets: Optional[Mapping[str, str]] = None,
security_group_ids: Optional[Sequence[str]] = None,
sidecars: Optional[Mapping[str, _compose.ServiceConfigArgs]] = None,
stop_grace_period: Optional[str] = None,
task_role_arn: Optional[str] = None,
triggers: Optional[Mapping[str, str]] = None,
volumes: Optional[Sequence[_compose.ServiceVolumeConfigArgs]] = None,
volumes_from: Optional[Sequence[str]] = None,
wait_for_steady_state: Optional[bool] = None,
working_dir: Optional[str] = None)func NewService(ctx *Context, name string, args ServiceArgs, opts ...ResourceOption) (*Service, error)public Service(string name, ServiceArgs args, ComponentResourceOptions? opts = null)
public Service(String name, ServiceArgs args)
public Service(String name, ServiceArgs args, ComponentResourceOptions options)
type: defang-aws:Service
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "defang-aws_service" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- options ComponentResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var serviceResource = new DefangAws.Service("serviceResource", new()
{
Image = "string",
ProjectName = "string",
Policies = new[]
{
"string",
},
Command = new[]
{
"string",
},
DependsOn =
{
{ "string", new DefangAws.Compose.Inputs.ServiceDependencyArgs
{
Condition = "string",
Required = false,
} },
},
Deploy = new DefangAws.Compose.Inputs.DeployConfigArgs
{
Replicas = 0,
Resources = new DefangAws.Compose.Inputs.ResourcesArgs
{
Reservations = new DefangAws.Compose.Inputs.ResourceConfigArgs
{
Cpus = 0,
Memory = "string",
},
},
},
DomainName = "string",
Entrypoint = new[]
{
"string",
},
Environment =
{
{ "string", "string" },
},
Aws = new DefangAws.Aws.Inputs.SharedInfraArgs
{
VpcID = "string",
ClusterArn = "string",
ExecutionRoleArn = "string",
LogGroupName = "string",
PrivateSgID = "string",
PrivateSubnetIDs = new[]
{
"string",
},
PrivateZoneID = "string",
PublicSubnetIDs = new[]
{
"string",
},
},
Ports = new[]
{
new DefangAws.Compose.Inputs.ServicePortConfigArgs
{
Target = 0,
AppProtocol = "string",
Listener = "string",
Mode = "string",
Protocol = "string",
},
},
Platform = "string",
ContainerName = "string",
Autoscaling = false,
HealthCheck = new DefangAws.Compose.Inputs.HealthCheckConfigArgs
{
IntervalSeconds = 0,
Retries = 0,
StartPeriodSeconds = 0,
Test = new[]
{
"string",
},
TimeoutSeconds = 0,
},
Secrets =
{
{ "string", "string" },
},
SecurityGroupIds = new[]
{
"string",
},
Sidecars =
{
{ "string", new DefangAws.Compose.Inputs.ServiceConfigArgs
{
Autoscaling = false,
Build = new DefangAws.Compose.Inputs.BuildConfigArgs
{
Context = "string",
Args =
{
{ "string", "string" },
},
CacheFrom = new[]
{
"string",
},
CacheTo = new[]
{
"string",
},
Dockerfile = "string",
Platforms = new[]
{
"string",
},
ShmSize = "string",
Target = "string",
},
Command = new[]
{
"string",
},
ContainerName = "string",
DependsOn =
{
{ "string", new DefangAws.Compose.Inputs.ServiceDependencyArgs
{
Condition = "string",
Required = false,
} },
},
Deploy = new DefangAws.Compose.Inputs.DeployConfigArgs
{
Replicas = 0,
Resources = new DefangAws.Compose.Inputs.ResourcesArgs
{
Reservations = new DefangAws.Compose.Inputs.ResourceConfigArgs
{
Cpus = 0,
Memory = "string",
},
},
},
DomainName = "string",
Entrypoint = new[]
{
"string",
},
Environment =
{
{ "string", "string" },
},
HealthCheck = new DefangAws.Compose.Inputs.HealthCheckConfigArgs
{
IntervalSeconds = 0,
Retries = 0,
StartPeriodSeconds = 0,
Test = new[]
{
"string",
},
TimeoutSeconds = 0,
},
Image = "string",
Llm = null,
NetworkMode = "string",
Networks =
{
{ "string", new DefangAws.Compose.Inputs.ServiceNetworkConfigArgs
{
Aliases = new[]
{
"string",
},
} },
},
Platform = "string",
Policies = new[]
{
"string",
},
Ports = new[]
{
new DefangAws.Compose.Inputs.ServicePortConfigArgs
{
Target = 0,
AppProtocol = "string",
Listener = "string",
Mode = "string",
Protocol = "string",
},
},
Postgres = new DefangAws.Compose.Inputs.PostgresConfigArgs
{
AllowDowntime = false,
FromSnapshot = "string",
},
Redis = new DefangAws.Compose.Inputs.RedisConfigArgs
{
AllowDowntime = false,
FromSnapshot = "string",
},
Restart = "string",
StopGracePeriod = "string",
Volumes = new[]
{
new DefangAws.Compose.Inputs.ServiceVolumeConfigArgs
{
Source = "string",
Target = "string",
ReadOnly = false,
},
},
VolumesFrom = new[]
{
"string",
},
WorkingDir = "string",
} },
},
StopGracePeriod = "string",
TaskRoleArn = "string",
Triggers =
{
{ "string", "string" },
},
Volumes = new[]
{
new DefangAws.Compose.Inputs.ServiceVolumeConfigArgs
{
Source = "string",
Target = "string",
ReadOnly = false,
},
},
VolumesFrom = new[]
{
"string",
},
WaitForSteadyState = false,
WorkingDir = "string",
});
example, err := defangaws.NewService(ctx, "serviceResource", &defangaws.ServiceArgs{
Image: pulumi.String("string"),
ProjectName: "string",
Policies: pulumi.StringArray{
"string",
},
Command: pulumi.StringArray{
"string",
},
DependsOn: compose.ServiceDependencyMap{
"string": &compose.ServiceDependencyArgs{
Condition: pulumi.String("string"),
Required: pulumi.Bool(false),
},
},
Deploy: &compose.DeployConfigArgs{
Replicas: pulumi.Int(0),
Resources: &compose.ResourcesArgs{
Reservations: &compose.ResourceConfigArgs{
Cpus: pulumi.Float64(0),
Memory: pulumi.String("string"),
},
},
},
DomainName: "string",
Entrypoint: pulumi.StringArray{
"string",
},
Environment: pulumi.StringMap{
"string": "string",
},
Aws: &aws.SharedInfraArgs{
VpcID: pulumi.String("string"),
ClusterArn: pulumi.String("string"),
ExecutionRoleArn: pulumi.String("string"),
LogGroupName: pulumi.String("string"),
PrivateSgID: pulumi.String("string"),
PrivateSubnetIDs: pulumi.StringArray{
pulumi.String("string"),
},
PrivateZoneID: pulumi.String("string"),
PublicSubnetIDs: pulumi.StringArray{
pulumi.String("string"),
},
},
Ports: compose.ServicePortConfigArray{
&compose.ServicePortConfigArgs{
Target: pulumi.Int(0),
AppProtocol: pulumi.String("string"),
Listener: pulumi.String("string"),
Mode: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
},
Platform: "string",
ContainerName: "string",
Autoscaling: false,
HealthCheck: &compose.HealthCheckConfigArgs{
IntervalSeconds: pulumi.Int(0),
Retries: pulumi.Int(0),
StartPeriodSeconds: pulumi.Int(0),
Test: pulumi.StringArray{
pulumi.String("string"),
},
TimeoutSeconds: pulumi.Int(0),
},
Secrets: pulumi.StringMap{
"string": "string",
},
SecurityGroupIds: pulumi.StringArray{
"string",
},
Sidecars: compose.ServiceConfigMap{
"string": &compose.ServiceConfigArgs{
Autoscaling: pulumi.Bool(false),
Build: &compose.BuildConfigArgs{
Context: pulumi.String("string"),
Args: pulumi.StringMap{
"string": pulumi.String("string"),
},
CacheFrom: pulumi.StringArray{
pulumi.String("string"),
},
CacheTo: pulumi.StringArray{
pulumi.String("string"),
},
Dockerfile: pulumi.String("string"),
Platforms: pulumi.StringArray{
pulumi.String("string"),
},
ShmSize: pulumi.String("string"),
Target: pulumi.String("string"),
},
Command: pulumi.StringArray{
pulumi.String("string"),
},
ContainerName: pulumi.String("string"),
DependsOn: compose.ServiceDependencyMap{
"string": &compose.ServiceDependencyArgs{
Condition: pulumi.String("string"),
Required: pulumi.Bool(false),
},
},
Deploy: &compose.DeployConfigArgs{
Replicas: pulumi.Int(0),
Resources: &compose.ResourcesArgs{
Reservations: &compose.ResourceConfigArgs{
Cpus: pulumi.Float64(0),
Memory: pulumi.String("string"),
},
},
},
DomainName: pulumi.String("string"),
Entrypoint: pulumi.StringArray{
pulumi.String("string"),
},
Environment: pulumi.StringMap{
"string": pulumi.String("string"),
},
HealthCheck: &compose.HealthCheckConfigArgs{
IntervalSeconds: pulumi.Int(0),
Retries: pulumi.Int(0),
StartPeriodSeconds: pulumi.Int(0),
Test: pulumi.StringArray{
pulumi.String("string"),
},
TimeoutSeconds: pulumi.Int(0),
},
Image: pulumi.String("string"),
Llm: &compose.LlmConfigArgs{},
NetworkMode: pulumi.String("string"),
Networks: compose.ServiceNetworkConfigMap{
"string": &compose.ServiceNetworkConfigArgs{
Aliases: pulumi.StringArray{
pulumi.String("string"),
},
},
},
Platform: pulumi.String("string"),
Policies: pulumi.StringArray{
pulumi.String("string"),
},
Ports: compose.ServicePortConfigArray{
&compose.ServicePortConfigArgs{
Target: pulumi.Int(0),
AppProtocol: pulumi.String("string"),
Listener: pulumi.String("string"),
Mode: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
},
Postgres: &compose.PostgresConfigArgs{
AllowDowntime: pulumi.Bool(false),
FromSnapshot: pulumi.String("string"),
},
Redis: &compose.RedisConfigArgs{
AllowDowntime: pulumi.Bool(false),
FromSnapshot: pulumi.String("string"),
},
Restart: pulumi.String("string"),
StopGracePeriod: pulumi.String("string"),
Volumes: compose.ServiceVolumeConfigArray{
&compose.ServiceVolumeConfigArgs{
Source: pulumi.String("string"),
Target: pulumi.String("string"),
ReadOnly: pulumi.Bool(false),
},
},
VolumesFrom: pulumi.StringArray{
pulumi.String("string"),
},
WorkingDir: pulumi.String("string"),
},
},
StopGracePeriod: "string",
TaskRoleArn: pulumi.String("string"),
Triggers: pulumi.StringMap{
"string": "string",
},
Volumes: compose.ServiceVolumeConfigArray{
&compose.ServiceVolumeConfigArgs{
Source: pulumi.String("string"),
Target: pulumi.String("string"),
ReadOnly: pulumi.Bool(false),
},
},
VolumesFrom: pulumi.StringArray{
"string",
},
WaitForSteadyState: false,
WorkingDir: "string",
})
resource "defang-aws_service" "serviceResource" {
image = "string"
project_name = "string"
policies = ["string"]
command = ["string"]
depends_on = {
"string" = {
condition = "string"
required = false
}
}
deploy = {
replicas = 0
resources = {
reservations = {
cpus = 0
memory = "string"
}
}
}
domain_name = "string"
entrypoint = ["string"]
environment = {
"string" = "string"
}
aws = {
vpc_id = "string"
cluster_arn = "string"
execution_role_arn = "string"
log_group_name = "string"
private_sg_id = "string"
private_subnet_i_ds = ["string"]
private_zone_id = "string"
public_subnet_i_ds = ["string"]
}
ports {
target = 0
app_protocol = "string"
listener = "string"
mode = "string"
protocol = "string"
}
platform = "string"
container_name = "string"
autoscaling = false
health_check = {
interval_seconds = 0
retries = 0
start_period_seconds = 0
test = ["string"]
timeout_seconds = 0
}
secrets = {
"string" = "string"
}
security_group_ids = ["string"]
sidecars = {
"string" = {
autoscaling = false
build = {
context = "string"
args = {
"string" = "string"
}
cache_from = ["string"]
cache_to = ["string"]
dockerfile = "string"
platforms = ["string"]
shm_size = "string"
target = "string"
}
command = ["string"]
container_name = "string"
depends_on = {
"string" = {
condition = "string"
required = false
}
}
deploy = {
replicas = 0
resources = {
reservations = {
cpus = 0
memory = "string"
}
}
}
domain_name = "string"
entrypoint = ["string"]
environment = {
"string" = "string"
}
health_check = {
interval_seconds = 0
retries = 0
start_period_seconds = 0
test = ["string"]
timeout_seconds = 0
}
image = "string"
llm = {}
network_mode = "string"
networks = {
"string" = {
aliases = ["string"]
}
}
platform = "string"
policies = ["string"]
ports = [{
"target" = 0
"appProtocol" = "string"
"listener" = "string"
"mode" = "string"
"protocol" = "string"
}]
postgres = {
allow_downtime = false
from_snapshot = "string"
}
redis = {
allow_downtime = false
from_snapshot = "string"
}
restart = "string"
stop_grace_period = "string"
volumes = [{
"source" = "string"
"target" = "string"
"readOnly" = false
}]
volumes_from = ["string"]
working_dir = "string"
}
}
stop_grace_period = "string"
task_role_arn = "string"
triggers = {
"string" = "string"
}
volumes {
source = "string"
target = "string"
read_only = false
}
volumes_from = ["string"]
wait_for_steady_state = false
working_dir = "string"
}
var serviceResource = new Service("serviceResource", ServiceArgs.builder()
.image("string")
.projectName("string")
.policies("string")
.command("string")
.dependsOn(Map.of("string", ServiceDependencyArgs.builder()
.condition("string")
.required(false)
.build()))
.deploy(DeployConfigArgs.builder()
.replicas(0)
.resources(ResourcesArgs.builder()
.reservations(ResourceConfigArgs.builder()
.cpus(0.0)
.memory("string")
.build())
.build())
.build())
.domainName("string")
.entrypoint("string")
.environment(Map.of("string", "string"))
.aws(SharedInfraArgs.builder()
.vpcID("string")
.clusterArn("string")
.executionRoleArn("string")
.logGroupName("string")
.privateSgID("string")
.privateSubnetIDs("string")
.privateZoneID("string")
.publicSubnetIDs("string")
.build())
.ports(ServicePortConfigArgs.builder()
.target(0)
.appProtocol("string")
.listener("string")
.mode("string")
.protocol("string")
.build())
.platform("string")
.containerName("string")
.autoscaling(false)
.healthCheck(HealthCheckConfigArgs.builder()
.intervalSeconds(0)
.retries(0)
.startPeriodSeconds(0)
.test("string")
.timeoutSeconds(0)
.build())
.secrets(Map.of("string", "string"))
.securityGroupIds("string")
.sidecars(Map.of("string", ServiceConfigArgs.builder()
.autoscaling(false)
.build(BuildConfigArgs.builder()
.context("string")
.args(Map.of("string", "string"))
.cacheFrom("string")
.cacheTo("string")
.dockerfile("string")
.platforms("string")
.shmSize("string")
.target("string")
.build())
.command("string")
.containerName("string")
.dependsOn(Map.of("string", ServiceDependencyArgs.builder()
.condition("string")
.required(false)
.build()))
.deploy(DeployConfigArgs.builder()
.replicas(0)
.resources(ResourcesArgs.builder()
.reservations(ResourceConfigArgs.builder()
.cpus(0.0)
.memory("string")
.build())
.build())
.build())
.domainName("string")
.entrypoint("string")
.environment(Map.of("string", "string"))
.healthCheck(HealthCheckConfigArgs.builder()
.intervalSeconds(0)
.retries(0)
.startPeriodSeconds(0)
.test("string")
.timeoutSeconds(0)
.build())
.image("string")
.llm(LlmConfigArgs.builder()
.build())
.networkMode("string")
.networks(Map.of("string", ServiceNetworkConfigArgs.builder()
.aliases("string")
.build()))
.platform("string")
.policies("string")
.ports(ServicePortConfigArgs.builder()
.target(0)
.appProtocol("string")
.listener("string")
.mode("string")
.protocol("string")
.build())
.postgres(PostgresConfigArgs.builder()
.allowDowntime(false)
.fromSnapshot("string")
.build())
.redis(RedisConfigArgs.builder()
.allowDowntime(false)
.fromSnapshot("string")
.build())
.restart("string")
.stopGracePeriod("string")
.volumes(ServiceVolumeConfigArgs.builder()
.source("string")
.target("string")
.readOnly(false)
.build())
.volumesFrom("string")
.workingDir("string")
.build()))
.stopGracePeriod("string")
.taskRoleArn("string")
.triggers(Map.of("string", "string"))
.volumes(ServiceVolumeConfigArgs.builder()
.source("string")
.target("string")
.readOnly(false)
.build())
.volumesFrom("string")
.waitForSteadyState(false)
.workingDir("string")
.build());
service_resource = defang_aws.Service("serviceResource",
image="string",
project_name="string",
policies=["string"],
command=["string"],
depends_on={
"string": {
"condition": "string",
"required": False,
},
},
deploy={
"replicas": 0,
"resources": {
"reservations": {
"cpus": float(0),
"memory": "string",
},
},
},
domain_name="string",
entrypoint=["string"],
environment={
"string": "string",
},
aws={
"vpc_id": "string",
"cluster_arn": "string",
"execution_role_arn": "string",
"log_group_name": "string",
"private_sg_id": "string",
"private_subnet_ids": ["string"],
"private_zone_id": "string",
"public_subnet_ids": ["string"],
},
ports=[{
"target": 0,
"app_protocol": "string",
"listener": "string",
"mode": "string",
"protocol": "string",
}],
platform="string",
container_name="string",
autoscaling=False,
health_check={
"interval_seconds": 0,
"retries": 0,
"start_period_seconds": 0,
"test": ["string"],
"timeout_seconds": 0,
},
secrets={
"string": "string",
},
security_group_ids=["string"],
sidecars={
"string": {
"autoscaling": False,
"build": {
"context": "string",
"args": {
"string": "string",
},
"cache_from": ["string"],
"cache_to": ["string"],
"dockerfile": "string",
"platforms": ["string"],
"shm_size": "string",
"target": "string",
},
"command": ["string"],
"container_name": "string",
"depends_on": {
"string": {
"condition": "string",
"required": False,
},
},
"deploy": {
"replicas": 0,
"resources": {
"reservations": {
"cpus": float(0),
"memory": "string",
},
},
},
"domain_name": "string",
"entrypoint": ["string"],
"environment": {
"string": "string",
},
"health_check": {
"interval_seconds": 0,
"retries": 0,
"start_period_seconds": 0,
"test": ["string"],
"timeout_seconds": 0,
},
"image": "string",
"llm": {},
"network_mode": "string",
"networks": {
"string": {
"aliases": ["string"],
},
},
"platform": "string",
"policies": ["string"],
"ports": [{
"target": 0,
"app_protocol": "string",
"listener": "string",
"mode": "string",
"protocol": "string",
}],
"postgres": {
"allow_downtime": False,
"from_snapshot": "string",
},
"redis": {
"allow_downtime": False,
"from_snapshot": "string",
},
"restart": "string",
"stop_grace_period": "string",
"volumes": [{
"source": "string",
"target": "string",
"read_only": False,
}],
"volumes_from": ["string"],
"working_dir": "string",
},
},
stop_grace_period="string",
task_role_arn="string",
triggers={
"string": "string",
},
volumes=[{
"source": "string",
"target": "string",
"read_only": False,
}],
volumes_from=["string"],
wait_for_steady_state=False,
working_dir="string")
const serviceResource = new defang_aws.Service("serviceResource", {
image: "string",
projectName: "string",
policies: ["string"],
command: ["string"],
dependsOn: {
string: {
condition: "string",
required: false,
},
},
deploy: {
replicas: 0,
resources: {
reservations: {
cpus: 0,
memory: "string",
},
},
},
domainName: "string",
entrypoint: ["string"],
environment: {
string: "string",
},
aws: {
vpcID: "string",
clusterArn: "string",
executionRoleArn: "string",
logGroupName: "string",
privateSgID: "string",
privateSubnetIDs: ["string"],
privateZoneID: "string",
publicSubnetIDs: ["string"],
},
ports: [{
target: 0,
appProtocol: "string",
listener: "string",
mode: "string",
protocol: "string",
}],
platform: "string",
containerName: "string",
autoscaling: false,
healthCheck: {
intervalSeconds: 0,
retries: 0,
startPeriodSeconds: 0,
test: ["string"],
timeoutSeconds: 0,
},
secrets: {
string: "string",
},
securityGroupIds: ["string"],
sidecars: {
string: {
autoscaling: false,
build: {
context: "string",
args: {
string: "string",
},
cacheFrom: ["string"],
cacheTo: ["string"],
dockerfile: "string",
platforms: ["string"],
shmSize: "string",
target: "string",
},
command: ["string"],
containerName: "string",
dependsOn: {
string: {
condition: "string",
required: false,
},
},
deploy: {
replicas: 0,
resources: {
reservations: {
cpus: 0,
memory: "string",
},
},
},
domainName: "string",
entrypoint: ["string"],
environment: {
string: "string",
},
healthCheck: {
intervalSeconds: 0,
retries: 0,
startPeriodSeconds: 0,
test: ["string"],
timeoutSeconds: 0,
},
image: "string",
llm: {},
networkMode: "string",
networks: {
string: {
aliases: ["string"],
},
},
platform: "string",
policies: ["string"],
ports: [{
target: 0,
appProtocol: "string",
listener: "string",
mode: "string",
protocol: "string",
}],
postgres: {
allowDowntime: false,
fromSnapshot: "string",
},
redis: {
allowDowntime: false,
fromSnapshot: "string",
},
restart: "string",
stopGracePeriod: "string",
volumes: [{
source: "string",
target: "string",
readOnly: false,
}],
volumesFrom: ["string"],
workingDir: "string",
},
},
stopGracePeriod: "string",
taskRoleArn: "string",
triggers: {
string: "string",
},
volumes: [{
source: "string",
target: "string",
readOnly: false,
}],
volumesFrom: ["string"],
waitForSteadyState: false,
workingDir: "string",
});
type: defang-aws:Service
properties:
autoscaling: false
aws:
clusterArn: string
executionRoleArn: string
logGroupName: string
privateSgID: string
privateSubnetIDs:
- string
privateZoneID: string
publicSubnetIDs:
- string
vpcID: string
command:
- string
containerName: string
dependsOn:
string:
condition: string
required: false
deploy:
replicas: 0
resources:
reservations:
cpus: 0
memory: string
domainName: string
entrypoint:
- string
environment:
string: string
healthCheck:
intervalSeconds: 0
retries: 0
startPeriodSeconds: 0
test:
- string
timeoutSeconds: 0
image: string
platform: string
policies:
- string
ports:
- appProtocol: string
listener: string
mode: string
protocol: string
target: 0
projectName: string
secrets:
string: string
securityGroupIds:
- string
sidecars:
string:
autoscaling: false
build:
args:
string: string
cacheFrom:
- string
cacheTo:
- string
context: string
dockerfile: string
platforms:
- string
shmSize: string
target: string
command:
- string
containerName: string
dependsOn:
string:
condition: string
required: false
deploy:
replicas: 0
resources:
reservations:
cpus: 0
memory: string
domainName: string
entrypoint:
- string
environment:
string: string
healthCheck:
intervalSeconds: 0
retries: 0
startPeriodSeconds: 0
test:
- string
timeoutSeconds: 0
image: string
llm: {}
networkMode: string
networks:
string:
aliases:
- string
platform: string
policies:
- string
ports:
- appProtocol: string
listener: string
mode: string
protocol: string
target: 0
postgres:
allowDowntime: false
fromSnapshot: string
redis:
allowDowntime: false
fromSnapshot: string
restart: string
stopGracePeriod: string
volumes:
- readOnly: false
source: string
target: string
volumesFrom:
- string
workingDir: string
stopGracePeriod: string
taskRoleArn: string
triggers:
string: string
volumes:
- readOnly: false
source: string
target: string
volumesFrom:
- string
waitForSteadyState: false
workingDir: string
Service Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Service resource accepts the following input properties:
- Image string
- Project
Name string - Autoscaling bool
- Aws
Defang
Labs. Defang Aws. Aws. Inputs. Shared Infra - Command List<string>
- Container
Name string - Depends
On Dictionary<string, DefangLabs. Defang Aws. Compose. Inputs. Service Dependency Args> - Deploy
Defang
Labs. Defang Aws. Compose. Inputs. Deploy Config - Domain
Name string - Entrypoint List<string>
- Environment Dictionary<string, string>
- Health
Check DefangLabs. Defang Aws. Compose. Inputs. Health Check Config - Platform string
- Policies List<string>
- Ports
List<Defang
Labs. Defang Aws. Compose. Inputs. Service Port Config> - Secrets Dictionary<string, string>
- Security
Group List<string>Ids - Sidecars
Dictionary<string, Defang
Labs. Defang Aws. Compose. Inputs. Service Config Args> - Stop
Grace stringPeriod - Task
Role stringArn - Triggers Dictionary<string, string>
- Volumes
List<Defang
Labs. Defang Aws. Compose. Inputs. Service Volume Config> - Volumes
From List<string> - Wait
For boolSteady State - Working
Dir string
- Image string
- Project
Name string - Autoscaling bool
- Aws
Shared
Infra Args - Command []string
- Container
Name string - Depends
On ServiceDependency Args - Deploy
Deploy
Config Args - Domain
Name string - Entrypoint []string
- Environment map[string]string
- Health
Check HealthCheck Config Args - Platform string
- Policies []string
- Ports
Service
Port Config Args - Secrets map[string]string
- Security
Group []stringIds - Sidecars
Service
Config Args - Stop
Grace stringPeriod - Task
Role stringArn - Triggers map[string]string
- Volumes
Service
Volume Config Args - Volumes
From []string - Wait
For boolSteady State - Working
Dir string
- image string
- project_
name string - autoscaling bool
- aws object
- command list(string)
- container_
name string - depends_
on map(object) - deploy object
- domain_
name string - entrypoint list(string)
- environment map(string)
- health_
check object - platform string
- policies list(string)
- ports list(object)
- secrets map(string)
- security_
group_ list(string)ids - sidecars map(object)
- stop_
grace_ stringperiod - task_
role_ stringarn - triggers map(string)
- volumes list(object)
- volumes_
from list(string) - wait_
for_ boolsteady_ state - working_
dir string
- image String
- project
Name String - autoscaling Boolean
- aws
Shared
Infra - command List<String>
- container
Name String - depends
On Map<String,ServiceDependency Args> - deploy
Deploy
Config - domain
Name String - entrypoint List<String>
- environment Map<String,String>
- health
Check HealthCheck Config - platform String
- policies List<String>
- ports
List<Service
Port Config> - secrets Map<String,String>
- security
Group List<String>Ids - sidecars
Map<String,Service
Config Args> - stop
Grace StringPeriod - task
Role StringArn - triggers Map<String,String>
- volumes
List<Service
Volume Config> - volumes
From List<String> - wait
For BooleanSteady State - working
Dir String
- image string
- project
Name string - autoscaling boolean
- aws
aws
Shared Infra - command string[]
- container
Name string - depends
On {[key: string]: composeService Dependency Args} - deploy
compose
Deploy Config - domain
Name string - entrypoint string[]
- environment {[key: string]: string}
- health
Check composeHealth Check Config - platform string
- policies string[]
- ports
compose
Service Port Config[] - secrets {[key: string]: string}
- security
Group string[]Ids - sidecars
{[key: string]: compose
Service Config Args} - stop
Grace stringPeriod - task
Role stringArn - triggers {[key: string]: string}
- volumes
compose
Service Volume Config[] - volumes
From string[] - wait
For booleanSteady State - working
Dir string
- image str
- project_
name str - autoscaling bool
- aws
aws.
Shared Infra Args - command Sequence[str]
- container_
name str - depends_
on Mapping[str, compose.Service Dependency Args] - deploy
compose.
Deploy Config Args - domain_
name str - entrypoint Sequence[str]
- environment Mapping[str, str]
- health_
check compose.Health Check Config Args - platform str
- policies Sequence[str]
- ports
Sequence[compose.
Service Port Config Args] - secrets Mapping[str, str]
- security_
group_ Sequence[str]ids - sidecars
Mapping[str, compose.
Service Config Args] - stop_
grace_ strperiod - task_
role_ strarn - triggers Mapping[str, str]
- volumes
Sequence[compose.
Service Volume Config Args] - volumes_
from Sequence[str] - wait_
for_ boolsteady_ state - working_
dir str
- image String
- project
Name String - autoscaling Boolean
- aws Property Map
- command List<String>
- container
Name String - depends
On Map<Property Map> - deploy Property Map
- domain
Name String - entrypoint List<String>
- environment Map<String>
- health
Check Property Map - platform String
- policies List<String>
- ports List<Property Map>
- secrets Map<String>
- security
Group List<String>Ids - sidecars Map<Property Map>
- stop
Grace StringPeriod - task
Role StringArn - triggers Map<String>
- volumes List<Property Map>
- volumes
From List<String> - wait
For BooleanSteady State - working
Dir String
Outputs
All input properties are implicitly available as output properties. Additionally, the Service resource produces the following output properties:
- Cluster
Name string - Endpoint string
- Service
Name string
- Cluster
Name string - Endpoint string
- Service
Name string
- cluster_
name string - endpoint string
- service_
name string
- cluster
Name String - endpoint String
- service
Name String
- cluster
Name string - endpoint string
- service
Name string
- cluster_
name str - endpoint str
- service_
name str
- cluster
Name String - endpoint String
- service
Name String
Supporting Types
BuildConfig, BuildConfigArgs
- context string
- args map(string)
- cache_
from list(string) - cache_
to list(string) - dockerfile string
- platforms list(string)
- shm_
size string - target string
- context str
- args Mapping[str, str]
- cache_
from Sequence[str] - cache_
to Sequence[str] - dockerfile str
- platforms Sequence[str]
- shm_
size str - target str
DeployConfig, DeployConfigArgs
- replicas Number
- resources Property Map
HealthCheckConfig, HealthCheckConfigArgs
- Interval
Seconds int - Retries int
- Start
Period intSeconds - Test List<string>
- Timeout
Seconds int
- Interval
Seconds int - Retries int
- Start
Period intSeconds - Test []string
- Timeout
Seconds int
- interval_
seconds number - retries number
- start_
period_ numberseconds - test list(string)
- timeout_
seconds number
- interval
Seconds Integer - retries Integer
- start
Period IntegerSeconds - test List<String>
- timeout
Seconds Integer
- interval
Seconds number - retries number
- start
Period numberSeconds - test string[]
- timeout
Seconds number
- interval_
seconds int - retries int
- start_
period_ intseconds - test Sequence[str]
- timeout_
seconds int
- interval
Seconds Number - retries Number
- start
Period NumberSeconds - test List<String>
- timeout
Seconds Number
PostgresConfig, PostgresConfigArgs
- Allow
Downtime bool - From
Snapshot string
- Allow
Downtime bool - From
Snapshot string
- allow_
downtime bool - from_
snapshot string
- allow
Downtime Boolean - from
Snapshot String
- allow
Downtime boolean - from
Snapshot string
- allow_
downtime bool - from_
snapshot str
- allow
Downtime Boolean - from
Snapshot String
RedisConfig, RedisConfigArgs
- Allow
Downtime bool - From
Snapshot string
- Allow
Downtime bool - From
Snapshot string
- allow_
downtime bool - from_
snapshot string
- allow
Downtime Boolean - from
Snapshot String
- allow
Downtime boolean - from
Snapshot string
- allow_
downtime bool - from_
snapshot str
- allow
Downtime Boolean - from
Snapshot String
ResourceConfig, ResourceConfigArgs
Resources, ResourcesArgs
ServiceConfig, ServiceConfigArgs
- Autoscaling bool
- Build
Defang
Labs. Defang Aws. Compose. Inputs. Build Config - Command List<string>
- Container
Name string - Depends
On Dictionary<string, DefangLabs. Defang Aws. Compose. Inputs. Service Dependency> - Deploy
Defang
Labs. Defang Aws. Compose. Inputs. Deploy Config - Domain
Name string - Entrypoint List<string>
- Environment Dictionary<string, string>
- Health
Check DefangLabs. Defang Aws. Compose. Inputs. Health Check Config - Image string
- Llm
Defang
Labs. Defang Aws. Compose. Inputs. Llm Config - Network
Mode string - Networks
Dictionary<string, Defang
Labs. Defang Aws. Compose. Inputs. Service Network Config> - Platform string
- Policies List<string>
- Ports
List<Defang
Labs. Defang Aws. Compose. Inputs. Service Port Config> - Postgres
Defang
Labs. Defang Aws. Compose. Inputs. Postgres Config - Redis
Defang
Labs. Defang Aws. Compose. Inputs. Redis Config - Restart string
- Stop
Grace stringPeriod - Volumes
List<Defang
Labs. Defang Aws. Compose. Inputs. Service Volume Config> - Volumes
From List<string> - Working
Dir string
- Autoscaling bool
- Build
Build
Config - Command []string
- Container
Name string - Depends
On ServiceDependency - Deploy
Deploy
Config - Domain
Name string - Entrypoint []string
- Environment map[string]string
- Health
Check HealthCheck Config - Image string
- Llm
Llm
Config - Network
Mode string - Networks
Service
Network Config - Platform string
- Policies []string
- Ports
Service
Port Config - Postgres
Postgres
Config - Redis
Redis
Config - Restart string
- Stop
Grace stringPeriod - Volumes
Service
Volume Config - Volumes
From []string - Working
Dir string
- autoscaling bool
- build object
- command list(string)
- container_
name string - depends_
on map(object) - deploy object
- domain_
name string - entrypoint list(string)
- environment map(string)
- health_
check object - image string
- llm object
- network_
mode string - networks map(object)
- platform string
- policies list(string)
- ports list(object)
- postgres object
- redis object
- restart string
- stop_
grace_ stringperiod - volumes list(object)
- volumes_
from list(string) - working_
dir string
- autoscaling Boolean
- build
Build
Config - command List<String>
- container
Name String - depends
On Map<String,ServiceDependency> - deploy
Deploy
Config - domain
Name String - entrypoint List<String>
- environment Map<String,String>
- health
Check HealthCheck Config - image String
- llm
Llm
Config - network
Mode String - networks
Map<String,Service
Network Config> - platform String
- policies List<String>
- ports
List<Service
Port Config> - postgres
Postgres
Config - redis
Redis
Config - restart String
- stop
Grace StringPeriod - volumes
List<Service
Volume Config> - volumes
From List<String> - working
Dir String
- autoscaling boolean
- build
compose
Build Config - command string[]
- container
Name string - depends
On {[key: string]: composeService Dependency} - deploy
compose
Deploy Config - domain
Name string - entrypoint string[]
- environment {[key: string]: string}
- health
Check composeHealth Check Config - image string
- llm
compose
Llm Config - network
Mode string - networks
{[key: string]: compose
Service Network Config} - platform string
- policies string[]
- ports
compose
Service Port Config[] - postgres
compose
Postgres Config - redis
compose
Redis Config - restart string
- stop
Grace stringPeriod - volumes
compose
Service Volume Config[] - volumes
From string[] - working
Dir string
- autoscaling bool
- build
compose.
Build Config - command Sequence[str]
- container_
name str - depends_
on Mapping[str, compose.Service Dependency] - deploy
compose.
Deploy Config - domain_
name str - entrypoint Sequence[str]
- environment Mapping[str, str]
- health_
check compose.Health Check Config - image str
- llm
compose.
Llm Config - network_
mode str - networks
Mapping[str, compose.
Service Network Config] - platform str
- policies Sequence[str]
- ports
Sequence[compose.
Service Port Config] - postgres
compose.
Postgres Config - redis
compose.
Redis Config - restart str
- stop_
grace_ strperiod - volumes
Sequence[compose.
Service Volume Config] - volumes_
from Sequence[str] - working_
dir str
- autoscaling Boolean
- build Property Map
- command List<String>
- container
Name String - depends
On Map<Property Map> - deploy Property Map
- domain
Name String - entrypoint List<String>
- environment Map<String>
- health
Check Property Map - image String
- llm Property Map
- network
Mode String - networks Map<Property Map>
- platform String
- policies List<String>
- ports List<Property Map>
- postgres Property Map
- redis Property Map
- restart String
- stop
Grace StringPeriod - volumes List<Property Map>
- volumes
From List<String> - working
Dir String
ServiceDependency, ServiceDependencyArgs
ServiceNetworkConfig, ServiceNetworkConfigArgs
- Aliases List<string>
- Aliases []string
- aliases list(string)
- aliases List<String>
- aliases string[]
- aliases Sequence[str]
- aliases List<String>
ServicePortConfig, ServicePortConfigArgs
- Target int
- App
Protocol string - Listener string
- Mode string
- Protocol string
- Target int
- App
Protocol string - Listener string
- Mode string
- Protocol string
- target number
- app_
protocol string - listener string
- mode string
- protocol string
- target Integer
- app
Protocol String - listener String
- mode String
- protocol String
- target number
- app
Protocol string - listener string
- mode string
- protocol string
- target int
- app_
protocol str - listener str
- mode str
- protocol str
- target Number
- app
Protocol String - listener String
- mode String
- protocol String
ServiceVolumeConfig, ServiceVolumeConfigArgs
SharedInfra, SharedInfraArgs
- Vpc
ID string - Cluster
Arn string - Execution
Role stringArn - Log
Group stringName - Private
Sg stringID - Private
Subnet List<string>IDs - Private
Zone stringID - Public
Subnet List<string>IDs
- Vpc
ID string - Cluster
Arn string - Execution
Role stringArn - Log
Group stringName - Private
Sg stringID - Private
Subnet []stringIDs - Private
Zone stringID - Public
Subnet []stringIDs
- vpc_
id string - cluster_
arn string - execution_
role_ stringarn - log_
group_ stringname - private_
sg_ stringid - private_
subnet_ list(string)i_ ds - private_
zone_ stringid - public_
subnet_ list(string)i_ ds
- vpc
ID String - cluster
Arn String - execution
Role StringArn - log
Group StringName - private
Sg StringID - private
Subnet List<String>IDs - private
Zone StringID - public
Subnet List<String>IDs
- vpc
ID string - cluster
Arn string - execution
Role stringArn - log
Group stringName - private
Sg stringID - private
Subnet string[]IDs - private
Zone stringID - public
Subnet string[]IDs
- vpc_
id str - cluster_
arn str - execution_
role_ strarn - log_
group_ strname - private_
sg_ strid - private_
subnet_ Sequence[str]ids - private_
zone_ strid - public_
subnet_ Sequence[str]ids
- vpc
ID String - cluster
Arn String - execution
Role StringArn - log
Group StringName - private
Sg StringID - private
Subnet List<String>IDs - private
Zone StringID - public
Subnet List<String>IDs
Package Details
- Repository
- defang-aws DefangLabs/pulumi-defang
- License
- Apache-2.0
Viewing docs for Defang AWS v2.4.1
published on Saturday, Jul 11, 2026 by Defang
published on Saturday, Jul 11, 2026 by Defang