-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement tags, log group retention and support s3 as source
- Loading branch information
0ptional
committed
Nov 13, 2020
1 parent
6fb3adb
commit c217221
Showing
16 changed files
with
461 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.vscode | ||
node_modules | ||
build | ||
build | ||
slstest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { PipelineConfig } from "./PluginConfig"; | ||
import { IAMRole } from "../types/IAMRole"; | ||
import { mapToTags } from "./util"; | ||
|
||
export function buildIAMRole(config: PipelineConfig): IAMRole { | ||
return { | ||
Type: 'AWS::IAM::Role', | ||
Properties: { | ||
Tags: mapToTags(config.tags), | ||
AssumeRolePolicyDocument: { | ||
Statement: [ | ||
{ | ||
Action: ['sts:AssumeRole'], | ||
Effect: 'Allow', | ||
Principal: { | ||
Service: [ | ||
'codepipeline.amazonaws.com', | ||
'codebuild.amazonaws.com' | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
Policies: [ | ||
{ | ||
PolicyName: 'CodePipelineFullAccess', | ||
PolicyDocument: { | ||
Statement: [ | ||
{ | ||
Action: '*', | ||
Effect: 'Allow', | ||
Resource: '*' | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { logGroupName } from "./util"; | ||
import { CodeBuildProject } from "../types/CodeBuildProject"; | ||
import { CloudWatchLogGroup } from "../types/CloudWatchLogGroup"; | ||
|
||
export function buildLogGroups(projects: CodeBuildProject[], logRetention?: number): CloudWatchLogGroup[] { | ||
return projects.map(project => ({ | ||
Type: 'AWS::Logs::LogGroup', | ||
Properties: { | ||
LogGroupName: logGroupName(project.Properties.Name), | ||
RetentionInDays: logRetention | ||
} | ||
})); | ||
} |
Oops, something went wrong.