Skip to content

Commit

Permalink
Feature/ci cd remove tags (#8)
Browse files Browse the repository at this point in the history
* Remove tag deployments

* Update README with diagrams for Arch and CI/CD

* Update README with badges and header
  • Loading branch information
san99tiago committed Sep 24, 2023
1 parent 2c56104 commit e7882d3
Show file tree
Hide file tree
Showing 7 changed files with 363 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: deploy
on:
push:
branches: [ 'main', 'feature/**']
tags: [ 'v*']
env:
AWS_DEFAULT_REGION: us-east-1
AWS_DEFAULT_OUTPUT: json
Expand Down
54 changes: 40 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,54 @@
# :bank: AWS-CDK-ORGANIZATIONS-DEMO :bank:

![Badge Workflow](https://github.com/san99tiago/aws-cdk-organizations-demo/actions/workflows/deploy.yml/badge.svg)

DEMO for the best practices of AWS Organizations with Infrastructure as Code on CDK-Python.

## TODO:

Add a detailed README with diagrams, explanations and examples of usage.
[![GitHub LICENSE](https://img.shields.io/github/license/san99tiago/aws-cdk-organizations-demo?style=plastic)](https://github.com/san99tiago/aws-cdk-organizations-demo/blob/main/LICENSE)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/san99tiago/aws-cdk-organizations-demo/deploy.yml?branch=main&label=deploy&style=plastic)](https://github.com/san99tiago/aws-cdk-organizations-demo/actions/workflows/deploy.yml)
[![GitHub Release (Latest SemVer)](https://img.shields.io/github/v/release/san99tiago/aws-cdk-organizations-demo?sort=semver&style=plastic)](https://github.com/san99tiago/aws-cdk-organizations-demo/releases)

# [<img src="assets/aws_dynamic.gif" width=10% align="center" alt="cool aws image" title="aws-cdk-organizations-demo">](https://github.com/san99tiago/aws-cdk-organizations-demo) AWS-CDK-ORGANIZATIONS-DEMO [<img src="assets/aws_dynamic.gif" width=10% align="center" alt="cool aws image" title="aws-cdk-organizations-demo">](https://github.com/san99tiago/aws-cdk-organizations-demo)

Advanced DEMO of [AWS Organizations](https://aws.amazon.com/organizations/) for sharing the best practices of managing multiple production-grade AWS Accounts with Infrastructure as Code on [CDK-Python](https://docs.aws.amazon.com/cdk/v2/guide/home.html).

## Architecture 🏦

This diagram illustrates the generated AWS Organizations structure with multiple OUs and Account.

<img src="assets/aws-cdk-organizations-demo.png" width=90%> <br>

```bash
# Hierarchy of the OUs and Accounts
OURoot/
├── 🏠ManagementAccount(🚩)
├── 📝OUInfrastructure/
│ ├── 📝OUInfrastructureNonProd/
│ │ └── 🏠AccountSharedServicesNonProd
│ └── 📝OUInfrastructureProd/
│ └── 🏠AccountSharedServicesProd
├── 📝OUWorkloads/
│ └── 📝OUFinance/
│ ├── 📝OUFinanceNonProd/
│ │ ├── 🏠AccountFinanceDev
│ │ └── 🏠AccountFinanceQA
│ └── 📝OUFinanceProd/
│ └── 🏠AccountFinanceProd
└── 📝OUPolicyStagingTests/
└── 🏠AccountPolicyStagingTests
```

## CI/CD and Deployment 🚀

The deployment process is intended to run with GitHub Actions Workflows.
The deployment process is intended to run with GitHub Actions Workflows and implementing the Cloud Development Tool (CDK) tool for managing the IaC and State.

<img src="assets/aws-cdk-organizations-demo-cicd.png" width=90%> <br>

- On `feature/****` branches commits, the CDK project gets **synthesized** and it shows the **state diff** between the current AWS resources and the expected ones.

- When merged to `main` branch, it will get deployed to the AWS Account automatically.

To understand the AWS Credentials usage, please refer to the [`prerequisites/README.md`](.github/prerequisites/README.md).
To understand the AWS Credentials usage for GitHub Actions auth, please refer to the [`prerequisites/README.md`](.github/prerequisites/README.md).

## Special thanks :gift:
## Special thanks 🎁

- Thanks to all contributors of the great OpenSource projects that I am using. <br>
- Huge shout-out to [pepperize/cdk-organizations](https://github.com/pepperize/cdk-organizations) for the Custom AWS-CDK Constructs that are provided for managing this project.

## Author :musical_keyboard:
## Author 🎹

### Santiago Garcia Arango

Expand Down
145 changes: 145 additions & 0 deletions assets/aws-cdk-organizations-demo-cicd.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<mxfile host="app.diagrams.net" modified="2023-09-24T04:50:03.991Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" etag="PIcm-BnLOebdPXAS3yeN" version="21.8.1" type="device">
<diagram name="Page-1" id="8FTfbC2rcARjfSEzrA1y">
<mxGraphModel dx="1695" dy="443" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-1" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=14;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="40" y="87" width="560" height="273" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="qcpOVHYHYP0Mq-8yIyMg-4" target="qcpOVHYHYP0Mq-8yIyMg-21" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="110" y="252" />
<mxPoint x="110" y="199" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-4" value="" style="shape=image;html=1;verticalAlign=top;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;imageAspect=0;aspect=fixed;image=https://cdn4.iconfinder.com/data/icons/ionicons/512/icon-social-github-128.png;fontSize=14;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="47.5" y="226" width="53" height="53" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-8" value="&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;GitOps" style="sketch=0;outlineConnect=0;fontColor=#232F3E;gradientColor=none;strokeColor=#232F3E;fillColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=14;fontStyle=1;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.users;" parent="1" vertex="1">
<mxGeometry x="-50" y="147.36" width="73" height="73" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-17" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://github.com/avatars/u/44036562?s=280&amp;v=4;fontSize=14;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="47.5" y="134" width="48" height="48" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="qcpOVHYHYP0Mq-8yIyMg-21" target="qcpOVHYHYP0Mq-8yIyMg-22" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="235" y="199" />
<mxPoint x="235" y="269" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="qcpOVHYHYP0Mq-8yIyMg-21" target="iks7YCqrPgkMSZUkMre9-2" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="235.19" y="199.13" />
<mxPoint x="235.19" y="132.13" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-21" value="Check&lt;br&gt;Coding Standards" style="rounded=1;whiteSpace=wrap;html=1;fontSize=14;fontStyle=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="130" y="160.13" width="82.19" height="78" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="qcpOVHYHYP0Mq-8yIyMg-22" target="iks7YCqrPgkMSZUkMre9-18" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="390" y="263" />
<mxPoint x="470" y="263" />
<mxPoint x="470" y="200" />
<mxPoint x="500" y="200" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-22" value="Run&lt;br&gt;Tests" style="rounded=1;whiteSpace=wrap;html=1;fontSize=14;fontStyle=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="318.72" y="244.11999999999998" width="70.85" height="49.5" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="iks7YCqrPgkMSZUkMre9-13" target="qcpOVHYHYP0Mq-8yIyMg-4" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="13" y="252.5" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-29" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Python-logo-notext.svg/701px-Python-logo-notext.svg.png;" parent="1" vertex="1">
<mxGeometry x="319.78999999999996" y="169.87" width="50.21" height="55" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-31" value="" style="rounded=1;whiteSpace=wrap;html=1;fontSize=16;fontStyle=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="620" y="130.32" width="100" height="137.62" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-36" value="GitHub Actions" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="44.56" y="189.75" width="60.25" height="30" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-39" value="[CI/CD]&amp;nbsp; &amp;nbsp; san99tiago/aws-cdk-organizations-demo" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontStyle=1;fontSize=22;" parent="1" vertex="1">
<mxGeometry x="45" y="47" width="550" height="40" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-40" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Pytest_logo.svg/2048px-Pytest_logo.svg.png;clipPath=inset(8% 31% 49% 30.67%);" parent="1" vertex="1">
<mxGeometry x="336.53" y="297.62" width="41.44" height="46.48" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-42" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://johnfraney.ca/blog/images/poetry.png;" parent="1" vertex="1">
<mxGeometry x="137.79" y="249.26999999999998" width="66.6" height="27.75" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-49" value="" style="shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;image=https://pypi-camo.global.ssl.fastly.net/d3a1a77162e3cd8c3d2089f27899b6eee71af013/68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f7073662f626c61636b2f6d61696e2f646f63732f5f7374617469632f6c6f676f322d726561646d652e706e67;" parent="1" vertex="1">
<mxGeometry x="99.64" y="279" width="142.91" height="52.49" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-50" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://coverage.readthedocs.io/en/latest/_static/sleepy-snake-circle-150.png;" parent="1" vertex="1">
<mxGeometry x="288.59" y="300.11" width="41.5" height="41.5" as="geometry" />
</mxCell>
<mxCell id="qcpOVHYHYP0Mq-8yIyMg-51" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://upload.wikimedia.org/wikipedia/commons/thumb/b/ba/Pytest_logo.svg/2048px-Pytest_logo.svg.png;clipPath=inset(55.67% 10.67% 13% 6%);" parent="1" vertex="1">
<mxGeometry x="382.36" y="310.61" width="54.51" height="20.5" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="iks7YCqrPgkMSZUkMre9-2" target="iks7YCqrPgkMSZUkMre9-14" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-2" value="CDK&lt;br&gt;Synth&lt;br&gt;&amp;amp; Diff" style="rounded=1;whiteSpace=wrap;html=1;fontSize=14;fontStyle=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="274.34" y="102" width="70" height="61.13" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-8" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Amazon_Web_Services_Logo.svg/640px-Amazon_Web_Services_Logo.svg.png;" parent="1" vertex="1">
<mxGeometry x="636.3" y="205.53" width="67.39" height="40.34" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-9" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://miro.medium.com/v2/resize:fit:500/1*LHt1OdlaWH2zM1jknkeYlg.png;" parent="1" vertex="1">
<mxGeometry x="270" y="189.75" width="44.25" height="44.25" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-13" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://git-scm.com/images/logos/downloads/Git-Icon-1788C.png;" parent="1" vertex="1">
<mxGeometry x="-45.65" y="220.36" width="64.29" height="64.29" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="iks7YCqrPgkMSZUkMre9-14" target="iks7YCqrPgkMSZUkMre9-18" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="470" y="133" />
<mxPoint x="470" y="200" />
<mxPoint x="500" y="200" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-14" value="IaC&lt;br&gt;Checkov&lt;br&gt;Validation" style="rounded=1;whiteSpace=wrap;html=1;fontSize=14;fontStyle=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="370" y="102" width="80" height="61.13" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-17" value="" style="shape=image;verticalLabelPosition=bottom;labelBackgroundColor=default;verticalAlign=top;aspect=fixed;imageAspect=0;image=https://github.com/raw/bridgecrewio/checkov/main/docs/web/images/checkov_by_bridgecrew.png;rotation=-30;" parent="1" vertex="1">
<mxGeometry x="366.11999999999995" y="198.39" width="87.76" height="29.55" as="geometry" />
</mxCell>
<mxCell id="zWsqOKRnjrgEfBXB0Wx7-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="iks7YCqrPgkMSZUkMre9-18" target="qcpOVHYHYP0Mq-8yIyMg-31">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-18" value="Deploy CDK&lt;br&gt;&amp;nbsp;&lt;br&gt;" style="rounded=1;whiteSpace=wrap;html=1;fontSize=14;fontStyle=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="500" y="152.54" width="80" height="93.19" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-24" value="" style="sketch=0;points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];points=[[0,0,0],[0.25,0,0],[0.5,0,0],[0.75,0,0],[1,0,0],[0,1,0],[0.25,1,0],[0.5,1,0],[0.75,1,0],[1,1,0],[0,0.25,0],[0,0.5,0],[0,0.75,0],[1,0.25,0],[1,0.5,0],[1,0.75,0]];outlineConnect=0;fontColor=#232F3E;fillColor=#E7157B;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.cloudformation;" parent="1" vertex="1">
<mxGeometry x="490" y="266.34000000000003" width="45" height="45" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-25" value="" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=center;html=1;shape=mxgraph.aws3.iam;fillColor=#759C3E;gradientColor=none;" parent="1" vertex="1">
<mxGeometry x="550" y="260.61" width="30" height="50" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-26" value="*main&lt;br&gt;branch only" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=11;fontStyle=1;fontColor=#FF0000;" parent="1" vertex="1">
<mxGeometry x="502.5" y="211.97" width="75" height="27.46" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-27" value="GitHub" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="43.88" y="279" width="60.25" height="30" as="geometry" />
</mxCell>
<mxCell id="iks7YCqrPgkMSZUkMre9-29" value="Management&lt;br style=&quot;font-size: 15px;&quot;&gt;Account" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=15;fontStyle=1" parent="1" vertex="1">
<mxGeometry x="624.5" y="147.36" width="91" height="59" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file added assets/aws-cdk-organizations-demo-cicd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e7882d3

Please sign in to comment.