Posts

Showing posts from May, 2022

Fix EC2 start and stop user policy

 {     "Version": "2012-10-17",     "Statement": [         {             "Sid": "VisualEditor0",             "Effect": "Allow",             "Action": "ec2:Describe*",             "Resource": "*"         },         {             "Sid": "VisualEditor1",             "Effect": "Allow",             "Action": [                 "ec2:RebootInstances",                 "ec2:StartInstances",                 "ec2:StopInstances"             ],             "Resource": [                 "arn:...

Create a single IAM user to access only specific S3 bucket

 Create a single IAM user to access only specific S3 bucket {   "Version": "2012-10-17",   "Statement": [     {       "Sid": "Stmt1528735049406",       "Action": [         "s3:DeleteObject",         "s3:GetObject",         "s3:HeadBucket",         "s3:ListBucket",         "s3:ListObjects",         "s3:PutObject"       ],       "Effect": "Allow",       "Resource": "arn:aws:s3:::YOURBUCKETNAME"     }   ] } {     "Version": "2012-10-17",     "Statement": [         {             "Sid": "BucketOperations",             "Effect": "Allow",             "Action": "s3:ListBucket*",             "Resource": "arn...

AWS API Gateway private integration with HTTP API and a VPC Link

 AWS API Gateway private integration with HTTP API and a VPC Link A. Create the ALB:-  1.Create it as an INTERNAL facing ALB. We don’t want to expose it to the internet. 2.There is only one listener on port 80 (This is the default). 3.Security Group that is created/assigned to the ALB can be fairly open for now (accept HTTP on TCP port 80 from anywhere). 4.In Step 4 of the wizard, the Target Group should have a target type as INSTANCE. Assuming that your EC2 is handling requests on port 80,  you can keep the rest of the parameters as default.  5 you can register your EC2 instance. allow security group 80 port. B. Create a VPC Link:- 1.From the EC2 console, add Security Group for the VPC Link. this can be pretty open for now, with HTTP traffic on port 80 allowed from anywhere. 2.While you are there, alter the ALB SG to accept traffic only from the VPC Link SG, only on port 80. 3.From the API Gateway console, create a new VPC Link for HTTP APIs. Choose the subnets in b...