{"id":19357866,"url":"https://github.com/swiftsoftwaregroup/aws-ec2-cdk-python","last_synced_at":"2026-02-03T06:39:46.528Z","repository":{"id":251130273,"uuid":"836460434","full_name":"swiftsoftwaregroup/aws-ec2-cdk-python","owner":"swiftsoftwaregroup","description":"Deploy EC2 instance with AWS CDK for Python","archived":false,"fork":false,"pushed_at":"2024-08-03T17:35:15.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T06:43:23.160Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftsoftwaregroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-31T22:45:30.000Z","updated_at":"2024-08-03T17:35:17.000Z","dependencies_parsed_at":"2024-08-03T18:49:52.774Z","dependency_job_id":null,"html_url":"https://github.com/swiftsoftwaregroup/aws-ec2-cdk-python","commit_stats":null,"previous_names":["swiftsoftwaregroup/ec2-aws-cdk-python","swiftsoftwaregroup/aws-ec2-cdk-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/swiftsoftwaregroup/aws-ec2-cdk-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-cdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-cdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-cdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-cdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftsoftwaregroup","download_url":"https://codeload.github.com/swiftsoftwaregroup/aws-ec2-cdk-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Faws-ec2-cdk-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261534980,"owners_count":23173506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T07:09:29.253Z","updated_at":"2026-02-03T06:39:41.492Z","avatar_url":"https://github.com/swiftsoftwaregroup.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ec2-aws-cdk-python\n\nDeploy EC2 instance using the AWS CDK for Python\n\n## Setup for macOS\n\nMake sure you do this setup first:\n\n1. [Setup macOS for AWS Cloud DevOps](https://blog.swiftsoftwaregroup.com/setup-macos-for-aws-cloud-devops)\n2. [AWS Authentication](https://blog.swiftsoftwaregroup.com/aws-authentication)\n3. [Install AWS CDK on macOS](https://blog.swiftsoftwaregroup.com/install-aws-cdk-macos)\n4. For Python support, install `pyenv`:\n\n    ```bash\n    brew install pyenv\n    ```\n\n## Development\n\nConfigure project:\n\n```bash\nsource configure.sh\n```\n\nOpen in Visual Studio Code:\n\n```bash\ncode .\n```\n\n### Deploy\n\nPrint the CloudFormation template for the stack. You should see the CloudFormation template without any errors:\n\n```bash\ncdk synth --profile default\n```\nBootstrap the CDK environment. This should be done only once per account. Skip this step if you have done it already. See [Bootstrapping](https://docs.aws.amazon.com/cdk/latest/guide/bootstrapping.html) for details:\n\n```bash\ncdk bootstrap --profile default\n```\nDeploy the stack:\n\n```bash\ncdk deploy --profile default\n```\n\n### Test Deployment\n\nCheck that you can browse the `nginx` default site:\n\n```bash\nkey=\"aws-ec2-key\"\ninstance=\"NginxEc2Stack/NginxInstance\"\n\ninstance_public_ip=$(aws ec2 describe-instances \\\n    --filters \\\n       Name=tag:Name,Values=$instance \\\n        Name=instance-state-name,Values=running \\\n| jq -r '.Reservations[0].Instances[0].PublicIpAddress')\n\nopen http://$instance_public_ip\n```\n\n### Cleanup\n\n```bash\ncdk destroy --profile default\n```\n\n**Opptional**: To delete the `CDKToolkit` CloudFormation template which is created by the AWS CDK during bootstrap:\n\n```bash\naws cloudformation delete-stack --stack-name CDKToolkit --profile default\n```\n\nThe bootstrap process creates an S3 Bucket with a name:  `cdk-\u003chash\u003e-assets-\u003caccount_id\u003e-\u003cregion\u003e`. This bucket will not be deleted automatically and will remain in your account if not deleted manually. \n\n## How to create a new project\n\n```bash\n# Node.js\nnvm use 20.16.0\n\n# Python\nmkdir ec2-aws-cdk-python\ncd ec2-aws-cdk-python\ncdk init app --language python --generate-only\n\nmv README.md README_MDK.md\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-cdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-cdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Faws-ec2-cdk-python/lists"}