Skip to content

Commit eba67cf

Browse files
authored
Merge pull request #663 from zjawol/fix/logs-arn
when role arn provided it will be used
2 parents 734ce25 + 26ab1f5 commit eba67cf

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/resources/Api.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,25 @@ export class Api {
147147
const policyLogicalId = this.naming.getLogGroupPolicyLogicalId();
148148
const apiLogicalId = this.naming.getApiLogicalId();
149149

150+
if (this.config.logging.roleArn) {
151+
return {
152+
[logGroupLogicalId]: {
153+
Type: 'AWS::Logs::LogGroup',
154+
Properties: {
155+
LogGroupName: {
156+
'Fn::Join': [
157+
'/',
158+
['/aws/appsync/apis', { 'Fn::GetAtt': [apiLogicalId, 'ApiId'] }],
159+
],
160+
},
161+
RetentionInDays:
162+
this.config.logging.retentionInDays ||
163+
this.plugin.serverless.service.provider.logRetentionInDays,
164+
},
165+
},
166+
};
167+
};
168+
150169
return {
151170
[logGroupLogicalId]: {
152171
Type: 'AWS::Logs::LogGroup',

0 commit comments

Comments
 (0)