Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ A basic example of a `deployment_map.yml` would look like the following:
```yaml
pipelines:
- name: iam
description: This description is used as a description for the CodeCommit repository.
default_providers:
source:
provider: codecommit
Expand Down Expand Up @@ -120,6 +121,7 @@ definition:
```yaml
pipelines:
- name: sample-ec2-java-app-codedeploy
description: This description is used as a description for the CodeCommit repository.
default_providers:
source:
provider: codecommit
Expand Down Expand Up @@ -194,9 +196,9 @@ targets:
name: another_step
wave:
size: 30 # (Optional) This forces the pipeline to split this OU into seperate stages, each stage containing up to X accounts
exclude:
- 9999999999 # (Optional) List of accounts to exclude from this target. Currently only supports account Ids
properties: ...
exclude:
- 9999999999 # (Optional) List of accounts to exclude from this target. Currently only supports account Ids
properties: ...
```

CodePipeline has a limit of 50 actions per stage.
Expand All @@ -216,8 +218,8 @@ Pipelines also have parameters that don't relate to a specific stage but rather
The following are the available pipeline parameters:

- *notification_endpoint* *(String) | (Dict) * defaults to none.
> Can either be a valid email address or a string that represents the name of a Slack Channel.
> A more complex configuration can be provided to integrate with Slack via AWS ChatBot.
> Can either be a valid email address or a string that represents the name of a Slack Channel.
> A more complex configuration can be provided to integrate with Slack via AWS ChatBot.
> ```yaml
> notification_endpoint:
> type: chat_bot
Expand Down Expand Up @@ -308,7 +310,7 @@ pipelines:
repository: my_test_repository
```

In the above example, the *ami-builder* pipeline is triggered when a new package version is published to the *my_test_repository* repository in CodeArtifact.
In the above example, the *ami-builder* pipeline is triggered when a new package version is published to the *my_test_repository* repository in CodeArtifact.

### Additional Deployment Maps

Expand Down Expand Up @@ -597,7 +599,7 @@ There are five different styles that one could choose from.
* In case the bucket is stored in any other region, it will return:
`https://${bucket}.s3-${region}.amazonaws.com/${key}`
* `s3-url` style, will return the S3 location using S3 URL with the `s3://` protocol.
As an example, this style is required for [CloudFormation AWS::Include transform](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html).
As an example, this style is required for [CloudFormation AWS::Include transform](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html).
* It returns: `s3://${bucket}/${key}`
* `s3-uri` style, will return the S3 location using S3 URI without specifying a protocol.
As an example, this style is required for [CodeBuild project source locations](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-source.html#cfn-codebuild-project-source-location).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@ Resources:
Sid: "CodeCommit"
Action:
- "codecommit:CreateRepository"
- "codecommit:UpdateRepository"
- "codecommit:UpdateRepositoryDescription"
- "codecommit:PutRepositoryTriggers"
- "codecommit:GetRepository"
- "codecommit:TagResource"
Resource:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ Resources:
Sid: "CodeCommit"
Action:
- "codecommit:CreateRepository"
- "codecommit:UpdateRepository"
- "codecommit:UpdateRepositoryDescription"
- "codecommit:PutRepositoryTriggers"
- "codecommit:GetRepository"
- "codecommit:TagResource"
Resource:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,12 @@ def create_update(self):
s3_key_path=None,
account_id=DEPLOYMENT_ACCOUNT_ID,
)
# Update the stack if the repo and the ADF controlled stack exist,
# return if the repo exists but no stack (previously made)

_repo_exists = self.repo_exists()
_stack_exists = cloudformation.get_stack_status()
if _repo_exists and not _stack_exists:
# return when the repository exists without a stack (previously made)
return
if not _repo_exists and not _stack_exists:
LOGGER.info(
'Ensuring State for CodeCommit Repository Stack %s on Account %s',
self.name,
self.account_id,
)
cloudformation.create_stack()
Comment on lines -84 to -90
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change here will perform updates to the CodeCommit CloudFormation stack.
Before we only created the repository, we didn't update it. I feel we should protect the code from being deleted by accident.
So we will also need an update policy to retain the repository just in case for that to be safe.
Can you add that?

See https://github.com/awslabs/aws-deployment-framework/blob/9420cdb908287dc545eff5a5bb3018f51b091046/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/codecommit.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure added it in f70bb46


LOGGER.info(f"Ensuring State for CodeCommit Repository Stack {self.name} on Account {self.account_id}")
cloudformation.create_stack()
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
PIPELINE_SCHEMA = {
"name": And(str, len),
"default_providers": PROVIDER_SCHEMA,
Optional("description"): str,
Optional("params"): PARAM_SCHEMA,
Optional("tags"): dict,
Optional("targets"): [Or(str, int, TARGET_SCHEMA, TARGET_LIST_SCHEMA)],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Resources:
Repo:
Type: AWS::CodeCommit::Repository
DeletionPolicy: Retain
UpdateReplacePolicy: Retain
Properties:
RepositoryName: !Ref RepoName
RepositoryDescription: !Ref Description