Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(parent, id, props) {
super(parent, id, props);
// Create an API service
this.api = new ecs.LoadBalancedFargateService(this, 'api', {
cluster: props.cluster,
image: ecs.ContainerImage.fromAsset(this, 'api-image', {
directory: './api'
}),
desiredCount: 2,
cpu: '256',
memory: '512',
environment: {
QUEUE_URL: props.screenshotQueue.queueUrl,
TABLE: props.screenshotTable.tableName
},
createLogs: true
});
props.screenshotQueue.grantSendMessages(this.api.service.taskDefinition.taskRole);
props.screenshotTable.grantReadWriteData(this.api.service.taskDefinition.taskRole);