Skip to content

Instantly share code, notes, and snippets.

View phanthaihuan's full-sized avatar

Huan phanthaihuan

  • Ho Chi Minh
View GitHub Profile
@phanthaihuan
phanthaihuan / lambda_deploy.yml
Created July 23, 2022 12:16 — forked from macedd/lambda_deploy.yml
Github Actions and Lambda Deployment (CD)
on:
push:
branches:
- master
paths:
- '**.py'
- '.github/workflows/lambda_deploy.yml'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@macedd
macedd / lambda_deploy.yml
Created February 18, 2020 05:03
Github Actions and Lambda Deployment (CD)
on:
push:
branches:
- master
paths:
- '**.py'
- '.github/workflows/lambda_deploy.yml'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
@keithweaver
keithweaver / save-file.py
Last active June 14, 2023 05:13
Save JSON file with Python
import json
def writeToJSONFile(path, fileName, data):
filePathNameWExt = './' + path + '/' + fileName + '.json'
with open(filePathNameWExt, 'w') as fp:
json.dump(data, fp)
# Example
data = {}
@philippelatulippe
philippelatulippe / terraform-ecs-asg-error.md
Created September 22, 2016 10:45
Terraform AWS: Unsupported service namespace, resource type or scalable dimension

If you try to attach an auto-scaling group to an ECS service and you get

Unsupported service namespace, resource type or scalable dimension

Then it's possible you didn't correctly format the resource_id in your aws_appautoscaling_target. It needs to be in the format service/clusterName/serviceName, and terraform will not format it for you. Try:

resource_id = "service/${aws_ecs_cluster.MY_CLUSTER.name}/${aws_ecs_service.MY_SERVICE.name}"