Last active
March 12, 2023 02:02
-
-
Save veevidify/9dc164e7e17fded14e2db0d482a146c0 to your computer and use it in GitHub Desktop.
Cloudy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# CF | |
aws cloudformation deploy --template-file template.yaml --stack-name Ec2Ssh --parameter-overrides file://params.json | |
aws cloudformation delete-stack --stack-name Ec2Ssh | |
# ECR | |
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com | |
docker tag hello-world:latest aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository | |
docker push aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"ParameterKey": "KeyName", | |
"ParameterValue": "YourKeyPairName" | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
KeyName: | |
Description: 'Ec2 key pair to ssh into the instance' | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
Resources: | |
Ec2Instance: | |
Type: 'AWS::EC2::Instance' | |
Properties: | |
SecurityGroups: | |
- !Ref InstanceSecurityGroup | |
KeyName: !Ref KeyName | |
ImageId: ami-0cdf84c392db3c246 | |
InstanceSecurityGroup: | |
Type: 'AWS::EC2::SecurityGroup' | |
Properties: | |
GroupDescription: 'Allow ssh via port 22' | |
SecurityGroupIngress: | |
- IpProtocol: tcp | |
FromPort: 22 | |
ToPort: 22 | |
CidrIp: 0.0.0.0/0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment