Skip to content

Commit

Permalink
Cleaninig and reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgatti committed Mar 1, 2020
1 parent 7ec32c6 commit 8515270
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/*.DS_Store
/CloudFormation.json
27 changes: 27 additions & 0 deletions 02_Metadata/interface.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"AWS::CloudFormation::Interface" : {
"ParameterGroups": [
{
"Label" : { "default" : "Basics" },
"Parameters" : [ "CodePipelineArtifactsParam" ]
},
{
"Label" : { "default" : "GitHub" },
"Parameters" : [ "GitHubAccountOwnerParam", "GitHubTokenParam", "StageParam", "AutoDeployParam" ]
},
{
"Label" : { "default" : "Product Configuration" },
"Parameters" : [ "EmailRestingPlace"]
}
],
"ParameterLabels": {
"CodePipelineArtifactsParam": { "default" : "CodePipeline Artifacts" },
"GitHubTokenParam": { "default" : "GitHub Token" },
"GitHubAccountOwnerParam": { "default" : "GitHub Owner" },
"StageParam": { "default" : "Deployment Stage" },
"AutoDeployParam": { "default" : "Autodeployment" },

"EmailRestingPlace": { "default" : "Email Bucket Name" }
}
}
}
2 changes: 1 addition & 1 deletion 03_Parameters/code_pipeline_bucket_name.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"CodePipelineBucketName": {
"CodePipelineArtifactsParam": {
"Description": "The S3 bucket name where CodePipeline will store the artifacts (this is needed only by CP to work, and pass task results to the next stage) - (This bucket needs to exist already in S3)",
"Type": "String"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ParamGitHubAccountName": {
"Description": "The name of the GitHub account, it is the same names that you find in the URL. Organization or private account.",
"GitHubAccountOwnerParam": {
"Description": "The name of the GitHub account, it is the same names that you find in the URL (Organization or private account).",
"Type": "String",
"Default": "0x4447"
}
Expand Down
4 changes: 2 additions & 2 deletions 03_Parameters/github_token.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"GitHubToken": {
"Description": "You need to create a Personal access tokens (https://github.com/settings/tokens) for CodePipeline to have access to the GitHub repo even if they are public, and the Scope has to have: repo and admin:repo_hook",
"GitHubTokenParam": {
"Description": "You need to create a Personal access tokens (https://github.com/settings/tokens) for CodePipeline to have access to the GitHub repo despite it being public. Find out more here: https://docs.aws.amazon.com/codepipeline/latest/userguide/GitHub-authentication.html",
"NoEcho": true,
"Type": "String"
}
Expand Down
4 changes: 2 additions & 2 deletions 03_Parameters/stage.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Stage": {
"Description": "Select what Stage are you deploying.",
"StageParam": {
"Description": "Select what type of environment are you deploying (branch of the repo).",
"Type": "String",
"AllowedValues": ["master", "development"],
"Default": "master",
Expand Down
2 changes: 1 addition & 1 deletion 07_Resources/Repos/converter/CodeBuild/Policies/s3.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": { "Fn::Sub": "arn:aws:s3:::${CodePipelineBucketName}/*"}
"Resource": { "Fn::Sub": "arn:aws:s3:::${CodePipelineArtifactsParam}/*"}
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions 07_Resources/Repos/converter/CodePipeline/_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Properties": {
"Name": "0x4447_s3_email_lambda_converter",
"ArtifactStore": {
"Location": { "Ref": "CodePipelineBucketName" },
"Location": { "Ref": "CodePipelineArtifactsParam" },
"Type": "S3"
},
"RoleArn": { "Fn::GetAtt": ["PipelineConverterRole", "Arn"] },
Expand All @@ -22,11 +22,11 @@
"Version": "1"
},
"Configuration": {
"Owner": { "Ref": "ParamGitHubAccountName" },
"Owner": { "Ref": "GitHubAccountOwnerParam" },
"Repo": "0x4447_product_s3_email_lambda_converter",
"Branch": { "Ref": "Stage" },
"Branch": { "Ref": "StageParam" },
"PollForSourceChanges": false,
"OAuthToken": { "Ref": "GitHubToken" }
"OAuthToken": { "Ref": "GitHubTokenParam" }
},
"OutputArtifacts": [
{
Expand Down
2 changes: 1 addition & 1 deletion 07_Resources/Repos/converter/CodePipeline/webhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Properties": {
"Authentication": "GITHUB_HMAC",
"AuthenticationConfiguration": {
"SecretToken": { "Ref": "GitHubToken" }
"SecretToken": { "Ref": "GitHubTokenParam" }
},
"Filters": [
{
Expand Down
2 changes: 1 addition & 1 deletion 07_Resources/Repos/inbound/CodeBuild/Policies/s3.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": { "Fn::Sub": "arn:aws:s3:::${CodePipelineBucketName}/*"}
"Resource": { "Fn::Sub": "arn:aws:s3:::${CodePipelineArtifactsParam}/*"}
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions 07_Resources/Repos/inbound/CodePipeline/_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Properties": {
"Name": "0x4447_s3_email_lambda_inbound",
"ArtifactStore": {
"Location": { "Ref": "CodePipelineBucketName" },
"Location": { "Ref": "CodePipelineArtifactsParam" },
"Type": "S3"
},
"RoleArn": { "Fn::GetAtt": ["PipelineInboundRole", "Arn"] },
Expand All @@ -22,11 +22,11 @@
"Version": "1"
},
"Configuration": {
"Owner": { "Ref": "ParamGitHubAccountName" },
"Owner": { "Ref": "GitHubAccountOwnerParam" },
"Repo": "0x4447_product_s3_email_lambda_inbound",
"Branch": { "Ref": "Stage" },
"Branch": { "Ref": "StageParam" },
"PollForSourceChanges": false,
"OAuthToken": { "Ref": "GitHubToken" }
"OAuthToken": { "Ref": "GitHubTokenParam" }
},
"OutputArtifacts": [
{
Expand Down
2 changes: 1 addition & 1 deletion 07_Resources/Repos/inbound/CodePipeline/webhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Properties": {
"Authentication": "GITHUB_HMAC",
"AuthenticationConfiguration": {
"SecretToken": { "Ref": "GitHubToken" }
"SecretToken": { "Ref": "GitHubTokenParam" }
},
"Filters": [
{
Expand Down
2 changes: 1 addition & 1 deletion 07_Resources/Repos/outbound/CodeBuild/Policies/s3.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": { "Fn::Sub": "arn:aws:s3:::${CodePipelineBucketName}/*"}
"Resource": { "Fn::Sub": "arn:aws:s3:::${CodePipelineArtifactsParam}/*"}
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions 07_Resources/Repos/outbound/CodePipeline/_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Properties": {
"Name": "0x4447_s3_email_lambda_outbound",
"ArtifactStore": {
"Location": { "Ref": "CodePipelineBucketName" },
"Location": { "Ref": "CodePipelineArtifactsParam" },
"Type": "S3"
},
"RoleArn": { "Fn::GetAtt": ["PipelineOutboundRole", "Arn"] },
Expand All @@ -22,11 +22,11 @@
"Version": "1"
},
"Configuration": {
"Owner": { "Ref": "ParamGitHubAccountName" },
"Owner": { "Ref": "GitHubAccountOwnerParam" },
"Repo": "0x4447_product_s3_email_lambda_outbound",
"Branch": { "Ref": "Stage" },
"Branch": { "Ref": "StageParam" },
"PollForSourceChanges": false,
"OAuthToken": { "Ref": "GitHubToken" }
"OAuthToken": { "Ref": "GitHubTokenParam" }
},
"OutputArtifacts": [
{
Expand Down
2 changes: 1 addition & 1 deletion 07_Resources/Repos/outbound/CodePipeline/webhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Properties": {
"Authentication": "GITHUB_HMAC",
"AuthenticationConfiguration": {
"SecretToken": { "Ref": "GitHubToken" }
"SecretToken": { "Ref": "GitHubTokenParam" }
},
"Filters": [
{
Expand Down

0 comments on commit 8515270

Please sign in to comment.