Skip to content

Commit 2393772

Browse files
dekobon4141doneJason Schmidtqdzlug
authored
Add support for the Pulumi Automation API (#167)
* feat: add Pulumi Automation API scripts with only AWS support This change adds Python scripts that use the Pulumi Automation API to stand up MARA like how the bin/start.sh scripts currently do. * feat: integrate Automation API scripts with k8s secrets This change adds a new Pulumi project named 'secrets' to MARA. This project is used in conjuction with the Pulumi Automation API to store secrets using the Kubernetes secret store so the secrets can be used across Pulumi projects. * feat: improve authentication error output This change outputs the results of the AWS cli command 'aws sts get-caller-identity' more tersely and without a stacktrace when the command fails. * feat: add differing behavior for container push per provider * docs: update examples to reflect changes to secrets * feat: add support for Digital Ocean to automation API scripts * feat: add support for Digital Ocean Container Registry * chore: upgrade default helm chart version * chore: upgrade example version for ingress image name * refactor: break headers into separate file * refactor: normalize PulumiProject path property naming The naming of the property "root_path" conflicted with the initialization parameter "path" AS WELL AS the method "path()". This change normalizes the property names such that they do not ambiguously overlap. * refactor: on_success closure params to single class We want to be able to easily add new references to the state that can be processed for on_success events. As such, the three variables passed to those closures has been refactored to a single type which references the original three variables. This will make adding new variables easier. * refactor: separate namespace creation from ingress controller When using container registry credentials with nginx ingress controller, one must create the credential secrets for the registry in the same namespace as the ingress controller. By breaking it apart as a separate step, it allows us to layer in additional logic (such as adding credentials) after the namespace has been created and before the ingress controller has been deployed. * refactor: add DO Registry credentials to k8s secrets via a project This change adds a new Pulumi project that gets the authentication credentials for a Digital Ocean Container Repository, encodes them as a Kubernetes secret, and then stores the secret in the running cluster's nginx-ingress namespace. * refactor: make pulumi color settings a method on EnvConfig * refactor: add container registry implementation name method * fix: AWS registry not being referenced using 'repository' AWS ECR refers to itself as a repository and not a registry, we aim to keep that naming consistent when referring directly to ECR nouns. This change fixes a bug where we became over-eager using the word 'registry' instead of the noun 'repository' that is hardcoded in the ECR stack reference. * bugfix: change pipenv install to pipenv sync to avoid updating deps at build time (#157) (cherry picked from commit 01ef1ff) * chore: deprecated convenience scripts and projects (#159) * chore: remove non-functional kubevip project * chore: deprecation of resources as discussed in #155 (cherry picked from commit b4ff561) * fix: typo in find command was causing pulumi stacks to not be deleted (#160) (cherry picked from commit 0619d5d) * chore: jenkins fixes and general cleanup of jenkinsfiles (#161) * fix: typo in find command was causing pulumi stacks to not be deleted * fix: formatting and find syntax in jenkins (esc for Groovy) * fix: formatting and find syntax in jenkins (esc for Groovy) * chore: clean up the comments a bit (cherry picked from commit cf655d0) * refactor: improve naming and fix typos * feat: install Digital Ocean CLI tool * feat: prompt user for parameters when starting up DO * feat: add dns record support to Digital Ocean provider * refactor: change name of container registry credentials project * docs: small comment addition and doc change Reference to the DO CLI is removed from the documentation because it is installed as part of the setup_venv.sh script. * chore: double Helm timeout for Prometheus install * feat: allow adding new clusters to the kubectl config Allow for adding and merging new clusters into the users kubectl config. The AWS and Digital Ocean CLIs do this automatically. However, not all SDKs nor CLI tools do this. Here we add code that does this so that the same type of functionality can be done no matter what the underlying infrastructure provider is. * refactor: add method to insert project in exec order Add a method to allow for the insertion of a project anywhere in the execution order of a provider. * chore: simplify function name * feat: add check for empty configuration file * refactor: break apart read and prompt operations * chore: change encoding to ascii because it is correct * feat: add automation API support for LKE and Harbor on Linode This adds support for Linode using the Automation API scripts. In order to provide support, the Harbor Container Registry was added to the requirements. Now, before starting LKE an instance of Harbor will be started in a Linode compute instance. * refactor: remove bash provision and destroy scripts * fix: typo in function parameter * docs: add additional code comments * feat: migrate to python logging for output * docs: add MARA Runner design document * fix: change sed flag from -r to posix compat -E Fixes #168 * feat: add easy runner script to MARA automation This change adds a bash script that sets up the virtual environment and invokes the automation/main.py script. Ideally, this would make running MARA much easier than it currently is. * fix: properly pass parameters to main.py from runner * refactor: improve error messaging and operations parsing * fix: fixes object has no attribute '__debug_logger_func' error Fixes #166 There is an issue with methods being named with two leading underscores being passed correctly to Pulumi's async handlers. In this change, we rename the method and add a check for the method's existence. * test: fix test runner to work after directory refactor * fix: enable force delete on ECR so that MARA can remove it * fix: sensible message on refresh run without prev deployment * fix: change import for better compatibility with test runner * chore: upgrade pulumi deps and kubectl versions * fix: add in updates to automation-api branch for version bumps (#172) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * chore: additional bug fixes and usability fixes to automation branch (#174) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * fix: removed JWT-only logic from BoS * fix: remove logic for sirius_host from deprecated jwt deploys * fix: remove deprecated ingress-repo-only project * fix: adjust min kubectl version deployed * chore: updates to fix digital ocean deployment (#177) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * fix: removed JWT-only logic from BoS * fix: remove logic for sirius_host from deprecated jwt deploys * fix: remove deprecated ingress-repo-only project * fix: adjust min kubectl version deployed * fix: refactor digitalocean to docean for variables * fix: provide ability to still run kubeconfig deploys until they are cut over to automation api (#179) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * fix: removed JWT-only logic from BoS * fix: remove logic for sirius_host from deprecated jwt deploys * fix: remove deprecated ingress-repo-only project * fix: adjust min kubectl version deployed * fix: refactor digitalocean to docean for variables * fix: add repo-only IC deploy to support kubeconfig deploys * fix: modifications to handle kubeconfig deploys for now * fix: recommission bash scripts to support kubeconfig deploys for now * fix: added gitkeep for IC manifests dir which is required for repo-only deploy (#180) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * fix: removed JWT-only logic from BoS * fix: remove logic for sirius_host from deprecated jwt deploys * fix: remove deprecated ingress-repo-only project * fix: adjust min kubectl version deployed * fix: refactor digitalocean to docean for variables * fix: add repo-only IC deploy to support kubeconfig deploys * fix: modifications to handle kubeconfig deploys for now * fix: recommission bash scripts to support kubeconfig deploys for now * fix: gitkeep needed for manifests dir under repo nginx * fix: updated jenkinsfiles for automation api work (#181) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * fix: removed JWT-only logic from BoS * fix: remove logic for sirius_host from deprecated jwt deploys * fix: remove deprecated ingress-repo-only project * fix: adjust min kubectl version deployed * fix: refactor digitalocean to docean for variables * fix: add repo-only IC deploy to support kubeconfig deploys * fix: modifications to handle kubeconfig deploys for now * fix: recommission bash scripts to support kubeconfig deploys for now * fix: gitkeep needed for manifests dir under repo nginx * chore: update jenkinsfiles for automation api * chore: doc updates for automation-api changes (#183) * fix: adding updates to jenkinsfiles (#185) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * fix: removed JWT-only logic from BoS * fix: remove logic for sirius_host from deprecated jwt deploys * fix: remove deprecated ingress-repo-only project * fix: adjust min kubectl version deployed * fix: refactor digitalocean to docean for variables * fix: add repo-only IC deploy to support kubeconfig deploys * fix: modifications to handle kubeconfig deploys for now * fix: recommission bash scripts to support kubeconfig deploys for now * fix: gitkeep needed for manifests dir under repo nginx * chore: update jenkinsfiles for automation api * fix: updates to the jenkinsfiles * chore: doc updates for automation-api changes * fix: update to docker instance for minikube jenkins * fix: add wheel back into setup_venv.sh (#187) * fix: add variable for password fields in jenkins runs / accept stack argument / formatting (#188) * chore: update cert-manager chart and crds * chore: update logagent (filebeat) chart version * chore: update nginx IC to latest chart version * chore: update prometheus chart to latest version * chore: update logstore (Elasticsearch) to latest chart versoin * chore: update observability to new yaml and new chart * chore: update example config with new values * fix: remediation of deployment bugs * fix: removed JWT-only logic from BoS * fix: remove logic for sirius_host from deprecated jwt deploys * fix: remove deprecated ingress-repo-only project * fix: adjust min kubectl version deployed * fix: refactor digitalocean to docean for variables * fix: add repo-only IC deploy to support kubeconfig deploys * fix: modifications to handle kubeconfig deploys for now * fix: recommission bash scripts to support kubeconfig deploys for now * fix: gitkeep needed for manifests dir under repo nginx * chore: update jenkinsfiles for automation api * fix: updates to the jenkinsfiles * chore: doc updates for automation-api changes * fix: update to docker instance for minikube jenkins * fix: add wheel back into setup_venv.sh * fix: jenkinsfile updates * feat: accept stack value on CLI, handle mis-match * chore: reformat markdown to fit standards * fix: changes requested in #188 * refactor: break up stack environment logic into fnctions * refactor: formatting changes to main.py * fix: address PR comments and formatting * refactor: formatting fixes * fix: formatting and PR requested changes * refactor: bash script cleanup * chore: remove deprecated testcap script * fix: shell isn't interpreting the args to pulumi right * fix: still having weird globbing issues. * fix: adjust jenkinsfiles for new runner syntax * fix: linode jenkinsfile and log level adjust / comment add (#194) * fix: update log level and add comment to clarify print stmt * fix: add closing braces for Linode Jenkinsfile * fix: cosmetic fix for || construct * feat: add new logo to repo (#195) Co-authored-by: Javier Evans <[email protected]> Co-authored-by: Jason Schmidt <[email protected]> Co-authored-by: Jason Schmidt <[email protected]>
1 parent 852af9f commit 2393772

File tree

105 files changed

+6972
-4511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+6972
-4511
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ A clear and concise description of what you want to happen.
1414
A clear and concise description of any alternative solutions or features you've considered.
1515

1616
**Additional context**
17-
Add any other context or screenshots about the feature request here.
17+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
### Proposed changes
2-
Describe the use case and detail of the change. If this PR addresses an issue
3-
on GitHub, make sure to include a link to that issue here in this description
2+
Describe the use case and detail of the change. If this PR addresses an issue
3+
on GitHub, make sure to include a link to that issue here in this description
44
(not in the title of the PR).
55

66
### Checklist
77
Before creating a PR, run through this checklist and mark each as complete.
88

9-
- [ ] I have written my commit messages in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.
9+
- [ ] I have written my commit messages in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.
1010
- [ ] I have read the [CONTRIBUTING](/CONTRIBUTING.md) doc
1111
- [ ] I have added tests (when possible) that prove my fix is effective or that my feature works
1212
- [ ] I have checked that all unit tests pass after adding my changes

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ override.tf.json
260260

261261
# End of https://www.toptal.com/developers/gitignore/api/python,pycharm+all,terraform
262262

263+
# Ignore locally installed pyenv environment
264+
.pyenv
265+
263266
*.pyc
264267
!/extras/jwt.token
265268
/pulumi/python/tools/common/config/*.yaml

.pre-commit-config.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.3.0
6+
hooks:
7+
- id: check-yaml
8+
args: [--allow-multiple-documents]
9+
- id: check-added-large-files
10+
- id: check-merge-conflict
11+
- id: detect-private-key
12+
- id: trailing-whitespace
13+
- id: mixed-line-ending
14+
- id: end-of-file-fixer
15+
- id: debug-statements
16+
- id: check-merge-conflict
17+
- id: check-ast
18+
19+
- repo: https://github.com/pre-commit/mirrors-autopep8
20+
rev: v1.7.0
21+
hooks:
22+
- id: autopep8
23+
24+
- repo: https://github.com/asottile/dead
25+
rev: v1.5.0
26+
hooks:
27+
- id: dead
28+
29+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
30+
rev: 3.0.0
31+
hooks:
32+
- id: shellcheck
33+
- id: shfmt
34+
- id: markdownlint
35+
36+
- repo: https://github.com/PyCQA/flake8
37+
rev: 5.0.4
38+
hooks:
39+
- id: flake8
40+
41+
- repo: https://github.com/zricethezav/gitleaks
42+
rev: v8.11.0
43+
hooks:
44+
- id: gitleaks
45+
46+
- repo: https://github.com/Yelp/detect-secrets
47+
rev: v1.3.0
48+
hooks:
49+
- id: detect-secrets

CODE_OF_CONDUCT.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,15 @@ the community.
117117

118118
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119119
version 2.0, available at
120-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html)
121+
.
121122

122-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
123-
enforcement ladder](https://github.com/mozilla/diversity).
123+
Community Impact Guidelines were inspired by
124+
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
124125

125126
[homepage]: https://www.contributor-covenant.org
126127

127128
For answers to common questions about this code of conduct, see the FAQ at
128-
https://www.contributor-covenant.org/faq. Translations are available at
129-
https://www.contributor-covenant.org/translations.
129+
[https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq)
130+
. Translations are available at
131+
[https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).

CONTRIBUTING.md

+36-17
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Contributing Guidelines
22

3-
The following is a set of guidelines for contributing. We really appreciate that you are considering contributing!
3+
The following is a set of guidelines for contributing. We really appreciate
4+
that you are considering contributing!
45

5-
#### Table Of Contents
6+
## Table Of Contents
67

78
[Ask a Question](#ask-a-question)
89

910
[Contributing](#contributing)
1011

1112
[Style Guides](#style-guides)
12-
* [Git Style Guide](#git-style-guide)
13-
* [Go Style Guide](#go-style-guide)
13+
14+
* [Git Style Guide](#git-style-guide)
15+
* [Go Style Guide](#go-style-guide)
1416

1517
[Code of Conduct](https://github.com/nginxinc/nginx-wrapper/blob/master/CODE_OF_CONDUCT.md)
1618

@@ -22,33 +24,50 @@ Please open an Issue on GitHub with the label `question`.
2224

2325
### Report a Bug
2426

25-
To report a bug, open an issue on GitHub with the label `bug` using the available bug report issue template. Please ensure the issue has not already been reported.
27+
To report a bug, open an issue on GitHub with the label `bug` using the
28+
available bug report issue template. Please ensure the issue has not already
29+
been reported.
2630

2731
### Suggest an Enhancement
2832

29-
To suggest an enhancement, please create an issue on GitHub with the label `enhancement` using the available feature issue template.
33+
To suggest an enhancement, please create an issue on GitHub with the label
34+
`enhancement` using the available feature issue template.
3035

3136
### Open a Pull Request
3237

33-
* Fork the repo, create a branch, submit a PR when your changes are tested and ready for review.
38+
* Fork the repo, create a branch, submit a PR when your changes are tested and
39+
ready for review.
3440
* Fill in [our pull request template](/.github/PULL_REQUEST_TEMPLATE.md)
3541

36-
Note: if you’d like to implement a new feature, please consider creating a feature request issue first to start a discussion about the feature.
42+
Note: if you’d like to implement a new feature, please consider creating a
43+
feature request issue first to start a discussion about the feature.
3744

3845
## Style Guides
3946

4047
### Git Style Guide
4148

42-
* Keep a clean, concise and meaningful git commit history on your branch, rebasing locally and squashing before submitting a PR
43-
* Use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format when writing a commit message, so that changelogs can be automatically generated
44-
* Follow the guidelines of writing a good commit message as described [here](https://chris.beams.io/posts/git-commit/) and summarised in the next few points
45-
* In the subject line, use the present tense ("Add feature" not "Added feature")
46-
* In the subject line, use the imperative mood ("Move cursor to..." not "Moves cursor to...")
47-
* Limit the subject line to 72 characters or less
48-
* Reference issues and pull requests liberally after the subject line
49-
* Add more detailed description in the body of the git message (`git commit -a` to give you more space and time in your text editor to write a good message instead of `git commit -am`)
49+
* Keep a clean, concise and meaningful git commit history on your branch,
50+
rebasing locally and squashing before submitting a PR
51+
* Use the
52+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format
53+
when writing a commit message, so that changelogs can be automatically
54+
generated
55+
* Follow the guidelines of writing a good commit message as described
56+
[here](https://chris.beams.io/posts/git-commit/) and summarised in the next
57+
few points
58+
* In the subject line, use the present tense
59+
("Add feature" not "Added feature")
60+
* In the subject line, use the imperative mood ("Move cursor to..." not
61+
"Moves cursor to...")
62+
* Limit the subject line to 72 characters or less
63+
* Reference issues and pull requests liberally after the subject line
64+
* Add more detailed description in the body of the git message (
65+
`git commit -a` to give you more space and time in your text editor to
66+
write a good message instead of `git commit -am`)
5067

5168
### Code Style Guide
5269

53-
* Python code should conform to the [PEP-8 style guidelines](https://www.python.org/dev/peps/pep-0008/) whenever possible.
70+
* Python code should conform to the
71+
[PEP-8 style guidelines](https://www.python.org/dev/peps/pep-0008/)
72+
whenever possible.
5473
* Where feasible, include unit tests.

README.md

+50-36
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,47 @@
1+
# NGINX Modern Reference Architectures
2+
3+
## Current Test Status
4+
15
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgit%40github.com%3Anginxinc%2Fkic-reference-architectures.git.svg?type=shield)](https://app.fossa.com/projects/custom%2B5618%2Fgit%40github.com%3Anginxinc%2Fkic-reference-architectures.git?ref=badge_shield)
2-
![AWS Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_aws_prod&subject=AWS)
3-
![DO Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_do_prod&subject=DigitalOcean)
4-
![LKE Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_lke_prod&subject=Linode)
6+
![AWS Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_aws_prod&subject=AWS)
7+
![DO Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_do_prod&subject=DigitalOcean)
8+
![LKE Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_lke_prod&subject=Linode)
59
![K3s Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_k3s_prod&subject=K3s)
610
![MicroK8s Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_mk8s_prod&subject=MicroK8s)
7-
![Minikube Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_minikube_prod&subject=Minikube)
11+
![Minikube Status](https://jenkins.mantawang.com/buildStatus/icon?job=mara_minikube_prod&subject=Minikube)
812

9-
# NGINX Modern Reference Architectures
13+
![MARA Project](./docs/NGINX-MARA-icon.png)
1014

11-
This repository has the basics for a common way to deploy and manage modern apps. Over time, we'll build more example
12-
architectures using different deployment models and options – including other clouds – and you’ll be able to find those
13-
here.
15+
This repository has the basics for a common way to deploy and manage modern
16+
apps. Over time, we'll build more example architectures using different
17+
deployment models and options – including other clouds – and you’ll be able
18+
to find those here.
1419

1520
## Nomenclature
1621

17-
Internally, we refer to this project as MARA for Modern Application Reference Architecture. The current repository name
18-
reflects the humble origins of this project, as it was started with the purpose of allowing users to build custom
19-
versions of the NGINX Ingress Controller in Kubernetes. This went so well that we expanded it to the project you're
20-
currently viewing.
22+
Internally, we refer to this project as MARA for Modern Application Reference
23+
Architecture. The current repository name reflects the humble origins of this
24+
project, as it was started with the purpose of allowing users to build custom
25+
versions of the NGINX Ingress Controller in Kubernetes. This went so well that
26+
we expanded it to the project you're currently viewing.
2127

2228
## Modern App Architectures
2329

2430
We define modern app architectures as those driven by four characteristics:
25-
*scalability*, *portability*, *resiliency*, and *agility*. While many different aspects of a modern architecture exist,
26-
these are fundamental.
31+
*scalability*, *portability*, *resiliency*, and *agility*. While many different
32+
aspects of a modern architecture exist, these are fundamental.
2733

28-
* **Scalability** – Quickly and seamlessly scale up or down to accommodate spikes or reductions in demand, anywhere in
29-
the world.
34+
* **Scalability** – Quickly and seamlessly scale up or down to accommodate
35+
spikes or reductions in demand, anywhere in the world.
3036

31-
* **Portability** – Easy to deploy on multiple types of devices and infrastructures, on public clouds, and on premises.
37+
* **Portability** – Easy to deploy on multiple types of devices and
38+
infrastructures, on public clouds, and on premises.
3239

33-
* **Resiliency** – Can fail over to newly spun‑up clusters or virtual environments in different availability regions,
34-
clouds, or data centers.
40+
* **Resiliency** – Can fail over to newly spun‑up clusters or virtual
41+
environments in different availability regions, clouds, or data centers.
3542

36-
* **Agility** – Ability to update through automated CI/CD pipelines with higher code velocity and more frequent code
37-
pushes.
43+
* **Agility** – Ability to update through automated CI/CD pipelines with higher
44+
code velocity and more frequent code pushes.
3845

3946
This diagram is an example of what we mean by a **modern app architecture**:
4047
![Modern Apps Architecture Example Diagram](docs/DIAG-NGINX-ModernAppsRefArch-NGINX-MARA-1-0-blog-1024x800.png)
@@ -53,26 +60,32 @@ To satisfy the four key characteristics, many modern app architectures employ:
5360

5461
For details on the current state of this project, please see the
5562
[readme](pulumi/python/README.md) in the [`pulumi/python`](pulumi/python)
56-
subdirectory. This project is under active development, and the current work is using [Pulumi](https://www.pulumi.com/)
57-
with Python. Additionally, please see
58-
[Status and Issues](docs/status-and-issues.md) for the project's up-to-date build status and known issues.
59-
60-
Subdirectories contained within the root directory separate reference architectures by infrastructure deployment tooling
61-
with additional subdirectories as needed. For example, Pulumi allows the use of multiple languages for deployment. As we
62-
decided to use Python in our first build, there is a `python` subdirectory under the `pulumi` directory.
63-
64-
This project was started to provide a complete, stealable, easy to deploy, and standalone example of how a modern app
65-
architecture can be built. It was driven by the necessity to be flexible and not require a long list of dependencies to
66-
get started. It needs to provide examples of tooling used to build this sort of architecture in the real world. Most
67-
importantly, it needs to work. Hopefully this provides a ‘jumping off’ point for someone to build their own
63+
subdirectory. This project is under active development, and the current work is
64+
using [Pulumi](https://www.pulumi.com/) with Python. Additionally, please see
65+
[Status and Issues](docs/status-and-issues.md) for the project's up-to-date
66+
build status and known issues.
67+
68+
Subdirectories contained within the root directory separate reference
69+
architectures by infrastructure deployment tooling with additional
70+
subdirectories as needed. For example, Pulumi allows the use of multiple
71+
languages for deployment. As we decided to use Python in our first build, there
72+
is a `python` subdirectory under the `pulumi` directory.
73+
74+
This project was started to provide a complete, stealable, easy to deploy, and
75+
standalone example of how a modern app architecture can be built. It was driven
76+
by the necessity to be flexible and not require a long list of dependencies to
77+
get started. It needs to provide examples of tooling used to build this sort of
78+
architecture in the real world. Most importantly, it needs to work. Hopefully
79+
this provides a ‘jumping off’ point for someone to build their own
6880
infrastructure.
6981

7082
## Deployment Tools
7183

7284
### Pulumi
7385

74-
[Pulumi](https://www.pulumi.com/) is a modern Infrastructure as Code (IaC) tool that allows you to write code (node,
75-
Python, Go, etc.) that defines cloud infrastructure. Within the [`pulumi`](pulumi) folder are examples of the pulumi
86+
[Pulumi](https://www.pulumi.com/) is a modern Infrastructure as Code (IaC) tool
87+
that allows you to write code (node, Python, Go, etc.) that defines cloud
88+
infrastructure. Within the [`pulumi`](pulumi) folder are examples of the pulumi
7689
being used to stand up MARA.
7790

7891
## Contribution
@@ -87,6 +100,7 @@ All code in this repository is licensed under the
87100
[Apache License v2 license](LICENSE).
88101

89102
Open source license notices for all projects in this repository can be
90-
found [here](https://app.fossa.com/reports/92595e16-c0b8-4c68-8c76-59696b6ac219).
103+
found
104+
[here](https://app.fossa.com/reports/92595e16-c0b8-4c68-8c76-59696b6ac219).
91105

92106
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B5618%2Fgit%40github.com%3Anginxinc%2Fkic-reference-architectures.git.svg?type=large)](https://app.fossa.com/projects/custom%2B5618%2Fgit%40github.com%3Anginxinc%2Fkic-reference-architectures.git?ref=badge_large)

bin/aws_write_creds.sh

+25-27
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,38 @@
22
set -o errexit # abort on nonzero exit status
33
set -o pipefail # don't hide errors within pipes
44

5-
#
6-
# This script is temporary until we rewrite the AWS deployment following #81 and #82.
7-
# We look into the environment and if we see environment variables for the AWS
8-
# authentication process we move them into a credentials file. This is primarily being
9-
# done at this time to support Jenkins using env vars for creds
5+
#
6+
# This script is temporary until we rewrite the AWS deployment following
7+
# 81 and #82. # We look into the environment and if we see environment
8+
# variables for the AWS # authentication process we move them into a
9+
# credentials file. This is primarily being # done at this time to support
10+
# Jenkins using env vars for creds
1011
#
1112

1213
aws_auth_vars=(AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN)
1314

1415
missing_auth_vars=()
15-
for i in "${aws_auth_vars[@]}"
16-
do
17-
test -n "${!i:+y}" || missing_vars+=("$i")
16+
for i in "${aws_auth_vars[@]}"; do
17+
test -n "${!i:+y}" || missing_vars+=("$i")
1818
done
1919

20-
if [ ${#missing_auth_vars[@]} -ne 0 ]
21-
then
22-
echo "Did not find values for:"
23-
printf ' %q\n' "${missing_vars[@]}"
24-
echo "Will assume they are in credentials file or not needed"
20+
if [ ${#missing_auth_vars[@]} -ne 0 ]; then
21+
echo "Did not find values for:"
22+
printf ' %q\n' "${missing_vars[@]}"
23+
echo "Will assume they are in credentials file or not needed"
2524
else
26-
echo "Creating credentials file"
27-
# Create the directory....
28-
mkdir -p ~/.aws
29-
CREDS=~/.aws/credentials
30-
echo "[default]" > $CREDS
31-
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" >> $CREDS
32-
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" >> $CREDS
33-
# This is if we have non-temp credentials...
34-
if [[ -z "${AWS_SESSION_TOKEN+x}" ]]; then
35-
echo "Variable AWS_SESSION_TOKEN was unset; not adding to credentials"
36-
else
37-
echo "aws_session_token=$AWS_SESSION_TOKEN" >> $CREDS
38-
fi
25+
echo "Creating credentials file"
26+
# Create the directory....
27+
mkdir -p ~/.aws
28+
CREDS=~/.aws/credentials
29+
echo "[default]" >$CREDS
30+
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" >>$CREDS
31+
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" >>$CREDS
32+
# This is if we have non-temp credentials...
33+
if [[ -z "${AWS_SESSION_TOKEN+x}" ]]; then
34+
echo "Variable AWS_SESSION_TOKEN was unset; not adding to credentials"
35+
else
36+
echo "aws_session_token=$AWS_SESSION_TOKEN" >>$CREDS
37+
fi
3938

4039
fi
41-

0 commit comments

Comments
 (0)