sparse-intern-71089
03/25/2021, 10:44 PMlittle-cartoon-10569
03/25/2021, 10:47 PMlittle-cartoon-10569
03/25/2021, 10:47 PMsquare-dress-80180
03/25/2021, 10:59 PMawslogs
driver, so may not need to go crazy. TBD. Thanks for the help!square-dress-80180
03/25/2021, 11:18 PM# Cloudwatch Prep
# The ecsInstanceRole should already have ability to send logs - don't
# need to create a policy and attach. Just click through to Cloudwatch logs
# from Pulumi/Stack/Resources.
flask_log_group = aws.cloudwatch.LogGroup("cookie-demo-app-microservice")
# Creating a task definition for the Flask instance.
flask_task_definition = aws.ecs.TaskDefinition("flask-task-definition",
family="frontend-task-definition-family",
cpu="256",
memory="512",
network_mode="awsvpc",
requires_compatibilities=["FARGATE"],
execution_role_arn=app_exec_role_arn,
task_role_arn=app_task_role_arn,
container_definitions=pulumi.Output.all(flask_image.image_name, flask_log_group.name).apply(lambda args: json.dumps([{
"name": "flask-container",
"image": args[0],
"memory": 512,
"essential": True,
"portMappings": [{
"containerPort": flask_app_listening_port,
"hostPort": flask_host_port,
"protocol": "tcp"
}],
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": args[1],
"awslogs-region": "us-east-2",
"awslogs-stream-prefix": env
}
}
}])))
square-dress-80180
03/25/2021, 11:18 PMlogConfiguration
section and good to go.No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by