add: iam construct
This commit is contained in:
parent
34eac25963
commit
c97f861ea4
3 changed files with 42 additions and 29 deletions
|
|
@ -95,19 +95,5 @@ export class BackEndCluster extends Construct {
|
|||
vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },
|
||||
});
|
||||
|
||||
// Secrets ManagerからのSecret取得ロール
|
||||
const ecsBackEndExecutionRole = iam.Role.fromRoleArn(
|
||||
this,
|
||||
"ecsBackEndExecutionRole",
|
||||
backendService.taskDefinition.executionRole!.roleArn,
|
||||
{}
|
||||
);
|
||||
ecsBackEndExecutionRole.attachInlinePolicy(new iam.Policy(this, 'SMGetPolicy', {
|
||||
statements: [new iam.PolicyStatement({
|
||||
actions: ['secretsmanager:GetSecretValue'],
|
||||
resources: [secretsDB.secretArn],
|
||||
})],
|
||||
}));
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue