Welcome to AWS re:Post
re:Post gives you access to a vibrant community that helps you become even more successful on AWS
Follow popular topics
see allRecent questions
see all1/18
- Hi! I have he following python structure that I need to port to AWS Lambda ``` app.py template.yaml important_lib/ ├─ __init__.py ├─ app.py ``` At SAM template my CodeUri: points to "/" but only `app.py` is added to the lambda My workaround is use makefile as build method, but I don't know if is the best way. With makefile I need to use docker to build the code (I'm using Windows 10) Any other alternatives to use folders with python in a .zip lambda package?
- What does EKS fargate mean by one pod one node? how many replicas of my deployment can I have in one fargate class? I made a deployment which resulted into pending pods kubectl describe pod frontend-app-79fd8cfd9f-4jjg5 -n dev gave me the following output: Warning FailedScheduling 3m7s default-scheduler 0/2 nodes are available: 2 Too many pods, 2 node(s) had untolerated taint {eks.amazonaws.com/compute-type: fargate}. preemption: 0/2 nodes are available: 2 Preemption is not helpful for scheduling.
- Hi Team, Is it possible to send messages from SQS to SES, is there any configurations in the console. Currently I am working in the ireland region, and have created a topic, while subscribing the only option i have found is Amazon SQS, but I want to send an email. So please help me if there is a way to send messages from SQS to SES in console
- I am following the official course by AWS on Coursera. I'd make an instance in EC2, it works like a charm. Then if I stop it and start again, it won't work (it shows running in console but the web page against it wont work based off of the IP address they way it'd work before). Then I create a new one exactly the way I had made the former one, it works too. Tested it a couple of times on different instances, what could possibly be wrong here ? Regards
-  I had mistakenly launched a db.r6g.large PostgreSQL instance and deleted it instantly while under Free Tier. I also deleted all the snapshots as well. Yet, I see daily increase in the bill by a few cents. Anyone knows what to do there? 
- Any idea what Geo-Ip database Route53 uses for geo based routing.
- Hi All, I am facing health check failed error in ALB target group when spinning AWS fargate task in ECS which is running container image with Spring boot hello API on 9099. Below are the details of steps, issues and how I am trying to debug. 1.) Built the docker image locally with sample hello API. deployed it on docker runtime running on my laptop. Tested with GET localhost:9099/hello in browser and postman. I am getting 200 OK response with body. Pushed this to AWS ECR. 2.) Created ECS task definition for image with - 4 vCPU, 10GB Memory. - Linux/x86/64 OS, awsvpc networking node, container port -9099 3.) Used above task definition to create task and run service with new ALB, new listener listening on 80 for request and new target group connecting to ECS task on 9099, below config - Health check grace period - 60 seconds. Fargate platform - tried with 1.3.0, 1.4.0 and latest version also( but issue remains same) ECS task's security group allowed - ALL TCP, TCP and 0-65535 from ALB security group and also added Custom TCP 9099 from source 0.0.0.0/0 and ::/0 so that I can test if container is responding from public and private IP. ALB and target group and listeners are created along with task. 4.) updated desired task to 1 so that it spines one task for container. instance get activated , comes in running state and able to access Spring boot API from browser and postman with public IP address also tested using private IPs of container instance from new EC2 instance and able to get success response. container logs showing entry. CPU and memory usages are good , no error in container instance. 5.) Issue starts here when I checked health check in ALB in target group, it says, Request time out and status is unhealthy. I realised, I didn't update anything in health check in target group which was running with default settings. 6.) Now Updated health check with below - Health check protocol - HTTP Health check path - /hello ( as this URL is responding with 200 Ok with private IP of container instance which is getting registered under target group.) Port - traffic port ( so 9099 should be used for health check also) Healthy threshold -2 Unhealthy threshold -3 Timeout -120 sec ( health check will have enough time and container instance will be up ) Interval - 150 sec success code -200-499 7.) Now when I updated ECS task with 0 and then back to 1, this time target group health check status is showing unhealthy and description is "Health check failed" that means health check is triggered but failed. I checked containers logs, there is no hit for /hello on 9099.( per my understanding , there should be in logs in container) meanwhile target group will keep registering and unregistering ECS container instance after 2 time and finally marking it unhealthy 8.) when I hit public DNS of ALB with 9099/hello in browser , it return 504 error. checked monitoring under target group - request reaches till target group but due to unhealthy target, it is not going to ECS. That means ALB security group not having any issue. 9.) Cloudwatch logs for ECS just showing spring boot API is running fine. No error reported. 10.) Enabled access logs of ALB to check if any details are getting captured about health check and what is the response code of health check, but no logs related to health check. Where to check health check detailed logs? 11.) ALB & ECS task is in single region us-east-1 , have added all 6 AZ in ALB and all 6 subnets (AZs) of VPC in ECS task also. 12.) Checked multiple post on stackoverflow and aws documentation from back 2020 and 2021 and other websites about this issue. Nothing helped me so far. 13.) My thought is if health check timeout is 120 seconds then target group will wait for 120 seconds for response from ECS. ECS health check grace period is 60 seconds which is good enough for ECS container to be up and running and ignore any health check till initial 60 seconds still health check has 60 more seconds and also after 150 seconds there will be second heath check call (Unhealthy threshold 3) so it health check should not fail. 14. To add one more point - I had tried adding 80 http port in ECS container instance security group for health check and had modified "Port" under target group health check to use " override" and used port 80. still no entry in ECS container task. It means there is something which is stopping request to reach to ECS from ALB target group. Please let me know if I am missing anything in these steps. Appreciate any pointers. Thanks I had done same with EC2 task type 2-3 weeks before and it worked without any change in health check param. Details @ https://medium.com/@rajesh.ranjan66/deploying-container-on-amazon-ecs-using-ec2-from-aws-console-e352563a2bf9?source=friends_link&sk=4345c10def0651dc9ccb9998ca939d93
- I am new to Amplify and development. I am hosting a server that is located in file "server.js" in the root of my Amplify app. It can be start on localhost with the console command "node server.js" when present in the root folder of my app (the file server.js is located in my root app folder). I push my project to GitHub , and connected it with Amplify. I can run this server on localhost but I cannot : 1. find my app files hosted on the server 2. how can I access my files on amplify server with terminal? 3. if I access the server with terminal then I hope I will be able to run console "node server.js" command to start the server online. Please let me know if anyone have a clue.
- I am having these failed status checks while trying to bring up a mac2.metal instance: System reachability check failed Instance reachability check failed This newly booted mac2.metal image using the Ventura fails: i-038f82a6383a1be5a Should I terminate the instance and try again? Or do I need to just wait for it to become available.
- are there any sample cost and usage reports from really complex environments available for download?
- Is it possible to inject a context variable into a REST API Gateway proxy request? Use case: I am storing an API key in a Secrets Manager. I want a custom authorizer to read the secret, and return it in the context. An API Gateway (REST flavour) proxies requests to the target API that needs to be authorized. And the goal is through the request mapping to inject the API key returned from the authorizer into the header of the proxied request. For example: `x-api-key: $context.authorizer.apiKey`
- I am using the docker compose ecs integration and found it extremely nice to be able to basically run your docker commands via ecs integration and viola behind the scenes everything you need is created for you in aws ecs. I have 2 services in my docker compose, my spring boot web app and my postgres db. I wanted to implement ssl and redirect all traffic to https. After a lot of research and a lot of trial and error I finally got it to work by extending my compose file with x-aws-cloudformation and adding native cloudformation yaml. When doing all of this I was forced to choose an application load balancer over a network load balancer as it operates on layer 7 (http/https). However my problem is that now I have no way of reaching my postgres database and running queries against it via for example intellij. My spring boot app works fine and can read/write to my database so that works fine. Before the whole ssl implementation I didn't specify a load balancer in my compose file and so it gave me a network load balancer every time I ran my compose file. Then I could connect to my database via intellij and run queries. I have tried adding an inbound rule on my security group that basically allows all inbound traffic to my database via 5432 but that didn't help. I may not be setting the correct host when applying my connection details in intellij but I have tried using the following: 1. dns name of load balancer 2. ip-adress of load balancer 3. public ip of my postgres db task (launch type: fargate) I would just like to simply reach my database and run queries against it even though it is running inside aws ecs cluster behind an application load balancer. Is there a way of achieving what I am trying to do? Or do I have to have 2 separate load balancers (one application LB and one network LB)? I know that there is an alternative to use RDS instead of ECS for my database. However it is a lot easier to have everything in one docker compose file. If I was able to set up an RDS instance via docker compose then that would have been lovely because I wouldn't have to manually set it up or use terraform to set it up and connect to it via my ecs cluster. Here is my docker-compose file(I have omitted a few irrelevant env variables): ``` version: "3.9" x-aws-loadbalancer: arn:my-application-load-balancer services: my-web-app: build: context: . image: hub/my-web-app x-aws-pull_credentials: xxxxxxxx container_name: my-app-name ports: - "80:80" networks: - my-app-network depends_on: - postgres deploy: replicas: 1 resources: limits: cpus: '0.5' memory: 2048M environment: - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/my-db?currentSchema=my-db_schema - SPRING_DATASOURCE_USERNAME=dbpass - SPRING_DATASOURCE_PASSWORD=dbpass - SPRING_DATASOURCE_DRIVER-CLASS-NAME=org.postgresql.Driver - SPRING_JPA_DATABASE_PLATFORM=org.hibernate.dialect.PostgreSQLDialect postgres: build: context: docker/database image: hub/my-db container_name: my-db networks: - my-app-network deploy: replicas: 1 resources: limits: cpus: '0.5' memory: 2048M environment: - POSTGRES_USER=dbpass - POSTGRES_PASSWORD=dbpass - POSTGRES_DB=my-db volumes: - my-app-db-data:/var/lib/postgresql/data volumes: my-app-db-data: name: my-app-db-volume networks: my-app-network: name: my-app-network x-aws-cloudformation: Resources: MyWebAppTCP80TargetGroup: Properties: HealthCheckPath: /actuator/health Matcher: HttpCode: 200-499 MyWebAppTCP80Listener: Type: AWS::ElasticLoadBalancingV2::Listener Properties: Protocol: HTTP Port: 80 LoadBalancerArn: xxxxx DefaultActions: - Type: redirect RedirectConfig: Port: 443 Host: "#{host}" Path: "/#{path}" Query: "#{query}" Protocol: HTTPS StatusCode: HTTP_301 MyWebAppTCP443Listener: Type: AWS::ElasticLoadBalancingV2::Listener Properties: Protocol: HTTPS Port: 443 LoadBalancerArn: xxxxxxxxx Certificates: - CertificateArn: "xxxxxxxxxx" DefaultActions: - Type: forward ForwardConfig: TargetGroups: - TargetGroupArn: Ref: MyWebAppTCP80TargetGroup MyWebAppTCP80RedirectRule: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: ListenerArn: Ref: MyWebAppTCP80Listener Priority: 1 Conditions: - Field: host-header HostHeaderConfig: Values: - "*.my-app.com" - "www.my-app.com" - "my-app.com" Actions: - Type: redirect RedirectConfig: Host: "#{host}" Path: "/#{path}" Query: "#{query}" Port: 443 Protocol: HTTPS StatusCode: HTTP_301 ```
- Hi, I have an environment on Elastic Beanstalk with Application Load Balancer listen to HTTPS and HTTP as well, we also have a auto scaling group with 6 to 10max instances. The application is facing an issue that we're struggling to find, a segfault (we're on it) once it happens in an instance it get terminated and start a new ok. However during the instance replacement, the state of the enviroment becomes "Severe" and the application get off, stops responding. We're looking for a solution for high availability, if we have 4 instances running and one requires to be terminated for some reason, shouldn't the balancer keep the enviroment live and available? What should we look for to have it in place?
- Hi There, We are pretty new to AWS World, and currently we are trying to setup some services in AWS. Our on-prem data centre needs connecting to AWS via Direct Connect and as an option for failover, we need to build the IPSEC VPNs. We have already built the IPSEC VPNs and they terminate on our on-prem firewalls over internet, now that we have Direct Connect available, can we connect this to our Core switch/router? And leave the IPSEC VPNs on firewalls. Another concern is we don't have spare 10G ports on firewalls to connect direct connect, but we have 10G ports on Core router? For the failover to work between Dx and IPSEC VPNs, is it necessary for AWS transit gateway to have same IP for peering IPSEC VPNs and BGP?
- I have a CodePipeline setup with the following workflow. 1. Step 1: Source stage: Integrated with GitHub 2. Step 2: Deploy stage: Integrated with EC2 The pipeline is triggered by GitHub source code changes (e.g code marge, push, etc). Once this action happens CodePipeline kicks off the stage executions, i.e grabs the code from GitHub branch and then moves to deploy (there's no build stage). This works perfectly when a **single developer**is working on the branch; My problem now is that if **multiple developers push changes** to the branch, the deploy stage fails if it had not finished executing the first action. How do I deal with this scenario?
- Sometimes after I trigger a deployment of ECS service the new task set is stuck with 1 desired task and 0 pending. There are no new ECS events (the last one is "service xxx has reached a steady state.") Creating new deployments does not help. It just replaces the primary task set which is also getting stuck at 1 desired and 0 pending)  The service is using EC2 capacity providers and ECS deployment controller. My settings are min 100% healthy max 200%. There is 1 task running prior to deployment. There are multiple container instances available and agent logs on the instance do not show anything unusual. The cloud trail does not show any failed calls for ECS service. Changing the desired count from 1 to 2 immediately creates 2 pending tasks.  Is there any extra information I can find? Is it possible that this is caused by a bug since there is no trace in ECS service events?
- My mac2-metal instance fails reachability status checks on boots. I tried to terminate the instance, but it is now stuck in the "Shutting-down" state. Please terminate this instance so I will be allowed to start a new one. i-0d17cbfe48596615e
- Hi. I have bitnami wordpress website run on an EC2 instance. Recently I cannot access my website through a web browser. The bitnami diagnostic tool told me that `server ports 22, 80 and/or 443 are not publicly accessible.` Website Port Checker also showed that the port 80 and 443 are closed. I used `netstat`, and results told me the ports are listening. Then I discovered this resolved issue: https://github.com/bitnami/vms/issues?q=is%3Aissue+is%3Aclosed+label%3Awordpress+port Where the author stated the ports were closed by the high-level due to malicious attack. How can I know whether this is what I encounter? I am on a basic support plan. I don't know who to talk to. I found a similar post from two years ago: https://repost.aws/questions/QU4yljRyJ7SLG9g81ZqxT31A/ec-2-instance-http-ports-blocked-on-aws-side And it seems fairly solved? Thanks.
Recent Knowledge Center content
see all1/18
AWS OFFICIALUpdated a month ago
AWS OFFICIALUpdated 3 months ago
AWS OFFICIALUpdated 3 months ago
AWS OFFICIALUpdated 3 months ago
AWS OFFICIALUpdated 3 months ago
AWS OFFICIALUpdated 2 months ago
AWS OFFICIALUpdated a year ago
AWS OFFICIALUpdated a year ago
AWS OFFICIALUpdated a year ago
AWS OFFICIALUpdated a year ago
AWS OFFICIALUpdated 3 months ago
AWS OFFICIALUpdated 5 months ago
AWS OFFICIALUpdated 2 years ago
AWS OFFICIALUpdated 2 years ago
Recent articles
see all1/18
- EXPERTpublished 3 days ago0 votes36 views
- EXPERTpublished 9 days ago3 votes69 views
- EXPERTpublished a month ago0 votes76 views
- EXPERTpublished a month ago0 votes47 views
- EXPERTpublished a month ago2 votes305 views
- EXPERTpublished a month ago1 votes184 views
- EXPERTpublished a month ago2 votes158 views
- EXPERTpublished a month ago0 votes111 views
- SUPPORT ENGINEERpublished a month ago0 votes131 views
- EXPERTpublished a month ago4 votes157 views
- EXPERTpublished 2 months ago0 votes90 views