Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
},
// eventBus: coffeeshop_eventbus,
ruleName: 'OrderCreatedRule',
});
//add ssm parameter store for cloudwatchevent put usage
const eventSourceParam = new ssm.StringParameter(this, 'eventSourceParam', {
parameterName: '/coffeeshop/events/ordercreated/event_source',
stringValue: 'solid.humank.coffeeshop.order',
});
// Grant read access to some Role
eventSourceParam.grantRead(fargateTaskRole);
//add ssm parameter store for cloudwatchevent put usage
const eventArnParam = new ssm.StringParameter(this, 'eventArnParam', {
parameterName: '/coffeeshop/events/ordercreated/event_arn',
stringValue: rule.ruleArn,
});
// Grant read access to some Role
eventArnParam.grantRead(fargateTaskRole);
// if the default image is not from ECR, the ECS task execution role will not have ECR pull privileges
// we need grant the pull for it explicitly
this.ecrRepository.grantPull({
grantPrincipal: (fargatesvc.service.taskDefinition.executionRole as iam.IRole)
})
// reduce the default deregistration delay timeout from 300 to 30 to accelerate the rolling update
fargatesvc.targetGroup.setAttribute('deregistration_delay.timeout_seconds', '30')
// customize the healthcheck to speed up the ecs rolling update
tableName: 'Coffee',
});
coffeeTable.grantFullAccess(fargateTaskRole);
const rule = new Rule(this, 'OrderCreatedRule',{
eventPattern:{
source:["solid.humank.coffeeshop.order"],
detailType:['customevent']
},
// eventBus: coffeeshop_eventbus,
ruleName: 'OrderCreatedRule',
});
//add ssm parameter store for cloudwatchevent put usage
const eventSourceParam = new ssm.StringParameter(this, 'eventSourceParam', {
parameterName: '/coffeeshop/events/ordercreated/event_source',
stringValue: 'solid.humank.coffeeshop.order',
});
// Grant read access to some Role
eventSourceParam.grantRead(fargateTaskRole);
//add ssm parameter store for cloudwatchevent put usage
const eventArnParam = new ssm.StringParameter(this, 'eventArnParam', {
parameterName: '/coffeeshop/events/ordercreated/event_arn',
stringValue: rule.ruleArn,
});
// Grant read access to some Role
eventArnParam.grantRead(fargateTaskRole);