From a331d56782593ab90c0bd60b5dfbfd6049ad7015 Mon Sep 17 00:00:00 2001 From: "Git Commiter for 96-fromsofia.net" <2a9-7cc@96-fromsofia.net> Date: Mon, 27 Feb 2023 00:43:53 +0000 Subject: [PATCH] First commit --- README.txt | 4 ++++ ec2-assign-eip.json | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 README.txt create mode 100644 ec2-assign-eip.json diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..1890e63 --- /dev/null +++ b/README.txt @@ -0,0 +1,4 @@ +Use this policy with an EC2 instance. +It will grant the necessary permissions for your instance to assign an EIP to itself. + +This can be used with an ASG without an LB to ensure your EC2 instance always has the same public IP. diff --git a/ec2-assign-eip.json b/ec2-assign-eip.json new file mode 100644 index 0000000..448470a --- /dev/null +++ b/ec2-assign-eip.json @@ -0,0 +1,14 @@ +{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "EC2AssociateEIP", + "Effect": "Allow", + "Action": "ec2:AssociateAddress", + "Resource": [ + "arn:aws:ec2:*::elastic-ip/", + "arn:aws:ec2:*::instance/*" + ] + } + ] +}