Skip to content

Commit

Permalink
Add Atmos Design Patterns docs (#486)
Browse files Browse the repository at this point in the history
* Update docs

* Update docs

* Update docs

* Update docs

* Update docs

* Update docs

* Update docs

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Update website/docs/design-patterns/inline-component-configuration.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Updates

* Update website/docs/quick-start/configure-terraform-backend.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/summary.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/summary.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/summary.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/design-patterns.mdx

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/design-patterns.mdx

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/component-inheritance.md

Co-authored-by: Dan Miller <[email protected]>

* Update website/docs/design-patterns/design-patterns.mdx

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Updates

* Updates

* Updates

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Update .goreleaser.yml

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* chore: update demo gif

* Update website/docs/design-patterns/abstract-component.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* chore: update demo gif

* Updates

* chore: update demo gif

* Apply suggestions from code review

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/component-catalog-template.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/component-catalog-template.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Updates

* chore: update demo gif

* Update website/docs/design-patterns/component-inheritance.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/component-inheritance.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/component-inheritance.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/component-overrides.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/layered-stack-configuration.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* chore: update demo gif

* Update website/docs/design-patterns/multiple-component-instances.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/organizational-structure-configuration.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/organizational-structure-configuration.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/organizational-structure-configuration.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/organizational-structure-configuration.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* Update website/docs/design-patterns/organizational-structure-configuration.md

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* chore: update demo gif

* Updates

* Updates

* chore: update demo gif

---------

Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
Co-authored-by: Dan Miller <[email protected]>
Co-authored-by: vhs-action 📼 <[email protected]>
  • Loading branch information
4 people authored Jan 9, 2024
1 parent 6d4951b commit 4618035
Show file tree
Hide file tree
Showing 128 changed files with 5,839 additions and 522 deletions.
9 changes: 4 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Visit https://goreleaser.com for documentation on how to customize this behavior.

before:
#hooks:
# - 'go mod tidy'

#before:
# hooks:
# - 'go mod tidy'
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
Expand Down Expand Up @@ -34,7 +33,7 @@ checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256

release:
#release:
# If you want to manually examine the release before it is live, uncomment this line:
# draft: true

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2020-2023 Cloud Posse, LLC
Copyright 2020-2024 Cloud Posse, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
13 changes: 6 additions & 7 deletions atmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,15 @@ schemas:
# Can also be set using 'ATMOS_SCHEMAS_OPA_BASE_PATH' ENV var, or '--schemas-opa-dir' command-line arguments
# Supports both absolute and relative paths
base_path: "stacks/schemas/opa"
# https://cuelang.org
cue:
# Can also be set using 'ATMOS_SCHEMAS_CUE_BASE_PATH' ENV var, or '--schemas-cue-dir' command-line arguments
# Supports both absolute and relative paths
base_path: "stacks/schemas/cue"
# JSON Schema to validate Atmos manifests
# https://www.schemastore.org/json
# https://atmos.tools/reference/schemas/
# https://atmos.tools/cli/commands/validate/stacks/
# https://atmos.tools/quick-start/configure-validation/
# https://atmos.tools/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
# https://json-schema.org/draft/2020-12/release-notes
# https://www.schemastore.org/json
# https://github.com/SchemaStore/schemastore
atmos:
# Can also be set using 'ATMOS_SCHEMAS_ATMOS_MANIFEST' ENV var, or '--schemas-atmos-manifest' command-line arguments
# Supports both absolute and relative paths (relative to the `base_path` setting in `atmos.yaml`)
manifest: "schemas/atmos-manifest/1.0/atmos-manifest.json"
manifest: "stacks/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json"
3 changes: 2 additions & 1 deletion cmd/atlantis_generate_repo_config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// atlantisGenerateRepoConfigCmd generates repository configuration for Atlantis
Expand Down
3 changes: 2 additions & 1 deletion cmd/aws_eks_update_kubeconfig.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// awsEksCmdUpdateKubeconfigCmd executes 'aws eks update-kubeconfig' command
Expand Down
3 changes: 2 additions & 1 deletion cmd/completion.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"
"os"

"github.com/spf13/cobra"

u "github.com/cloudposse/atmos/pkg/utils"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/describe_component.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// describeComponentCmd describes configuration for components
Expand Down
3 changes: 2 additions & 1 deletion cmd/describe_config.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// describeComponentCmd describes configuration for components
Expand Down
3 changes: 2 additions & 1 deletion cmd/describe_stacks.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// describeStacksCmd describes configuration for stacks and components in the stacks
Expand Down
3 changes: 2 additions & 1 deletion cmd/helmfile_generate_varfile.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// helmfileGenerateVarfileCmd generates varfile for a helmfile component
Expand Down
3 changes: 2 additions & 1 deletion cmd/terraform_generate_backend.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// terraformGenerateBackendCmd generates backend config for a terraform component
Expand Down
3 changes: 2 additions & 1 deletion cmd/terraform_generate_backends.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// terraformGenerateBackendsCmd generates backend configs for all terraform components
Expand Down
3 changes: 2 additions & 1 deletion cmd/terraform_generate_varfile.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// terraformGenerateVarfileCmd generates varfile for a terraform component
Expand Down
3 changes: 2 additions & 1 deletion cmd/terraform_generate_varfiles.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// terraformGenerateVarfilesCmd generates varfiles for all terraform components in all stacks
Expand Down
3 changes: 2 additions & 1 deletion cmd/validate_component.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// validateComponentCmd validates atmos components
Expand Down
9 changes: 9 additions & 0 deletions cmd/validate_stacks.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cmd

import (
cfg "github.com/cloudposse/atmos/pkg/config"
"github.com/cloudposse/atmos/pkg/schema"
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
Expand All @@ -18,6 +20,13 @@ var ValidateStacksCmd = &cobra.Command{
if err != nil {
u.LogErrorAndExit(err)
}

cliConfig, err := cfg.InitCliConfig(schema.ConfigAndStacksInfo{}, false)
if err != nil {
u.LogErrorAndExit(err)
}

u.LogInfo(cliConfig, "all stacks validated successfully\n")
},
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/vendor_diff.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// vendorDiffCmd executes 'vendor diff' CLI commands
Expand Down
8 changes: 5 additions & 3 deletions cmd/vendor_pull.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// vendorPullCmd executes 'vendor pull' CLI commands
Expand All @@ -21,10 +22,11 @@ var vendorPullCmd = &cobra.Command{
}

func init() {
vendorPullCmd.PersistentFlags().StringP("component", "c", "", "atmos vendor pull --component <component>")
vendorPullCmd.PersistentFlags().StringP("stack", "s", "", "atmos vendor pull --stack <stack>")
vendorPullCmd.PersistentFlags().StringP("component", "c", "", "Only vendor the specified component: atmos vendor pull --component <component>")
vendorPullCmd.PersistentFlags().StringP("stack", "s", "", "Only vendor the specified stack: atmos vendor pull --stack <stack>")
vendorPullCmd.PersistentFlags().StringP("type", "t", "terraform", "atmos vendor pull --component <component> --type=terraform|helmfile")
vendorPullCmd.PersistentFlags().Bool("dry-run", false, "atmos vendor pull --component <component> --dry-run")
vendorPullCmd.PersistentFlags().String("tags", "", "Only vendor the components that have the specified tags: atmos vendor pull --tags=dev,test")

vendorCmd.AddCommand(vendorPullCmd)
}
3 changes: 2 additions & 1 deletion cmd/workflow.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)

// workflowCmd executes a workflow
Expand Down
12 changes: 6 additions & 6 deletions demo.tape
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,19 @@ Sleep 1

Type "# Let's see what components we have available!" Sleep 500ms Enter
Type "atmos list components" Sleep 500ms Enter
Sleep 500ms
Sleep 1

Type "# Let's see where they can be deployed" Sleep 500ms Enter
Type "atmos list stacks" Sleep 500ms Enter
Sleep 1

Type "# Let's review the production VPC configuration in the ue2 region..." Sleep 500ms Enter
Type "atmos describe stacks --components=vpc --stack=plat-uw2-prod --sections=vars" Sleep 500ms Enter
Sleep 500ms
Type "# Let's review the production VPC configuration in the us-east-2 region..." Sleep 500ms Enter
Type "atmos describe stacks --components=vpc --stack=plat-ue2-prod --sections=vars" Sleep 500ms Enter
Sleep 1

Type "# Or checkout all VPCs" Sleep 500ms Enter
Type "atmos describe stacks --components=vpc --sections=vars | less" Sleep 500ms Enter
Sleep 500ms
Sleep 1

Down 25 Sleep 500ms
Down 25 Sleep 500ms
Expand All @@ -72,4 +73,3 @@ Type "# check out the docs at https://atmos.tools/" Sleep 500ms Enter
Sleep 500ms
Type "# or join us in #atmos at https://slack.cloudposse.com!" Sleep 500ms Enter
Sleep 2s

Binary file modified docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions examples/quick-start/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ ARG GEODESIC_VERSION=2.8.0
ARG GEODESIC_OS=debian

# atmos: https://github.com/cloudposse/atmos
ARG ATMOS_VERSION=1.51.0
ARG ATMOS_VERSION=1.53.0

# Terraform: https://github.com/hashicorp/terraform/releases
ARG TF_VERSION=1.6.5
ARG TF_VERSION=1.6.6

FROM cloudposse/geodesic:${GEODESIC_VERSION}-${GEODESIC_OS}

Expand All @@ -25,13 +25,17 @@ ENV AWS_VAULT_ENABLED=false
ENV AWS_VAULT_SERVER_ENABLED=false
ENV GEODESIC_TF_PROMPT_ACTIVE=false
ENV DIRENV_ENABLED=false
ENV NAMESPACE="acme"

# Enable advanced AWS assume role chaining for tools using AWS SDK
# https://docs.aws.amazon.com/sdk-for-go/api/aws/session/
ENV AWS_SDK_LOAD_CONFIG=1
ENV AWS_DEFAULT_REGION=us-east-2

# With Terraform 1.4, the default is for Terraform lock files to be required for cached providers to be used. It is a long story.
# See https://developer.hashicorp.com/terraform/cli/v1.4.x/config/config-file#allowing-the-provider-plugin-cache-to-break-the-dependency-lock-file
# for details. The short story is by setting this environment variable, we can continue the previous behavior.
ENV TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE=true

# Install specific version of Terraform
ARG TF_VERSION
RUN apt-get update && apt-get install -y -u --allow-downgrades \
Expand Down
19 changes: 6 additions & 13 deletions examples/quick-start/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ export DOCKER_IMAGE ?= $(DOCKER_ORG)/atmos
export DOCKER_TAG ?= latest
export DOCKER_IMAGE_NAME ?= $(DOCKER_IMAGE):$(DOCKER_TAG)
export APP_NAME = atmos
GEODESIC_INSTALL_PATH ?= /usr/local/bin
export INSTALL_PATH ?= $(GEODESIC_INSTALL_PATH)
export SCRIPT = $(INSTALL_PATH)/$(APP_NAME)
export ADR_DOCS_DIR = docs/adr
export ADR_DOCS_README = $(ADR_DOCS_DIR)/README.md
BUILD_HARNESS_EXTENSIONS_PATH := $(CURDIR)/.build-harness-extensions

# Default install path, if lacking permissions, ~/.local/bin will be used instead
export INSTALL_PATH ?= /usr/local/bin

-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness)

.DEFAULT_GOAL := default
.DEFAULT_GOAL := all

## Initialize build-harness, install deps, build docker container, install wrapper script and run shell
all: init deps build install run
Expand All @@ -26,14 +23,10 @@ deps:
build:
@make --no-print-directory docker/build

## Push docker image to registry
push:
@$(call fail,Refusing to push $(DOCKER_IMAGE_NAME) to docker hub)

## Install wrapper script from geodesic container
install:
@docker run --rm $(DOCKER_IMAGE_NAME) | bash -s $(DOCKER_TAG) || (echo "Try: sudo make install"; exit 1)
@docker run --rm --env APP_NAME --env DOCKER_IMAGE --env DOCKER_TAG --env INSTALL_PATH $(DOCKER_IMAGE_NAME) | bash -s $(DOCKER_TAG)

## Start the geodesic shell by calling wrapper script
run:
$(SCRIPT)
@$(APP_NAME)
14 changes: 14 additions & 0 deletions examples/quick-start/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ deploying and destroying Terraform and helmfile components, as well as running w
Refer to the Atmos [Quick Start](https://atmos.tools/category/quick-start/) guide that describes the steps to configure and provision the
infrastructure from this repository.

## Run Atmos Docker Image

To run the Atmos Docker image, execute the following command:

```shell
make all
```

## Noticeable Atmos commands

<details>
<summary> Noticeable Atmos commands:</summary>

Expand Down Expand Up @@ -50,3 +60,7 @@ atmos terraform apply vpc-flow-logs-bucket -s plat-uw2-staging
atmos terraform apply vpc-flow-logs-bucket -s plat-uw2-prod
```
</details>

<br/>

For the description of the Atmos CLI configuration and all CLI commands, refer to [Atmos CLI](https://atmos.tools/cli/configuration).
Loading

0 comments on commit 4618035

Please sign in to comment.