Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add inputs #7

Merged
merged 2 commits into from
Sep 27, 2024
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
37 changes: 30 additions & 7 deletions .github/workflows/pulumi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,30 @@ on:
options:
- dev
default: dev
image_uri:
az_number:
type: string
description: Number of Availability Zones
default: "2"
container_image_uri:
type: string
description: Image URI
default: nginx
default: "nginx"
container_cpu:
type: string
description: Container CPU
default: "256"
container_memory:
type: string
description: Container Memory
default: "512"
container_port:
type: string
description: Container Port
default: "80"
host_port:
type: string
description: Host Port
default: "80"

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -24,11 +44,12 @@ env:

AWS_RESOURCE_PREFIX: "pulumi-${{ inputs.environment }}"
AWS_RESOURCE_SHORT_PREFIX: "p-${{ inputs.environment }}" # Max 6 chars
AWS_AZ_NUMBER: "2"
CONTAINER_IMAGE_URI: ${{ inputs.image_uri }}
CONTAINER_CPU: "256"
CONTAINER_MEMORY: "512"
CONTAINER_PORT: "80"
AWS_AZ_NUMBER: ${{ inputs.az_number }}
CONTAINER_IMAGE_URI: ${{ inputs.container_image_uri }}
CONTAINER_CPU: ${{ inputs.container_cpu }}
CONTAINER_MEMORY: ${{ inputs.container_memory }}
CONTAINER_PORT: ${{ inputs.container_port }}
HOST_PORT: ${{ inputs.host_port }}


jobs:
Expand Down Expand Up @@ -69,6 +90,7 @@ jobs:
pulumi config set cpu $CONTAINER_CPU
pulumi config set memory $CONTAINER_MEMORY
pulumi config set container_port $CONTAINER_PORT
pulumi config set host_port $HOST_PORT
working-directory: pulumi

- name: Pulumi Preview
Expand Down Expand Up @@ -120,6 +142,7 @@ jobs:
pulumi config set cpu $CONTAINER_CPU
pulumi config set memory $CONTAINER_MEMORY
pulumi config set container_port $CONTAINER_PORT
pulumi config set host_port $HOST_PORT
working-directory: pulumi

- name: Pulumi Deploy Infrastructure
Expand Down
1 change: 1 addition & 0 deletions pulumi/Pulumi.original.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ config:
cpu: 256
memory: 512
container_port: 80
host_port: 80
6 changes: 3 additions & 3 deletions pulumi/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
cpu = config.require("cpu")
memory = config.require("memory")
container_port = config.require_int("container_port")

host_port = config.require_int("host_port")

# Functions
def prefixed(name):
Expand Down Expand Up @@ -242,8 +242,8 @@ def create_tags(name):
'name': 'app',
'image': image_uri,
'portMappings': [{
'containerPort': 80,
'hostPort': 80,
'containerPort': container_port,
'hostPort': host_port,
'protocol': 'tcp'
}]
}]),
Expand Down
Loading