Closed sunmingtao closed 3 years ago
Follow up, to specify the environment variables in AWS ECS
In the console:
Cloudformation
TaskDefinition:
Type: AWS::ECS::TaskDefinition
Properties:
Family: soccer-bet-task
Cpu: 256
Memory: 512
NetworkMode: awsvpc
ExecutionRoleArn: !Ref ExecutionRole
ContainerDefinitions:
- Name: soccer-bet-container
Image: 527875336349.dkr.ecr.ap-southeast-2.amazonaws.com/soccer-bet
PortMappings:
- ContainerPort: 8080
LogConfiguration:
LogDriver: awslogs
Options:
awslogs-region: !Ref AWS::Region
awslogs-group: !Ref LogGroup
awslogs-stream-prefix: ecs
Environment:
- Name: JAVA_OPTS
Value: -Damazon.aws.accesskey=*** -Damazon.aws.secretkey=***
RequiresCompatibilities:
- EC2
- FARGATE
Dockerfile
Command line