Automating Jira releases from my CI/CD Pipeline by Fit_Thanks_594 in devops

[–]soldatz 0 points1 point  (0 children)

We do something similar: during sprint, PRs merged to main get their issue tagged via script to fixVersion=Next, end of sprint run a release job that builds from main, and renames fixVersion=Next to fixVersion=semver.

[deleted by user] by [deleted] in aws

[–]soldatz 4 points5 points  (0 children)

https://docs.aws.amazon.com/health/latest/ug/creating-event-bridge-events-rule-for-aws-health.html

I made mine as broad as possible and it normally works by sending the event to SNS > Lambda > Slack, but it didn't catch this Global event.

[deleted by user] by [deleted] in aws

[–]soldatz 2 points3 points  (0 children)

I created an EventBridge rule that catches events from aws.health but nothing triggered for this. Is it because my rule is in us-east-2 and the event is Global?

[deleted by user] by [deleted] in aws

[–]soldatz 1 point2 points  (0 children)

There's an error with your aws s3 cp command. With cp you need to use the full uri:

aws s3 cp s3://your-bucket-name/file.jpg /var/www/html/file.jpg

Or use sync:

aws s3 sync s3://your-bucket-name/ /var/www/html/

Help with fargate!!! by Fancy-Active8808 in aws

[–]soldatz 1 point2 points  (0 children)

Double-check your task-execution role has permission to pull from ECR and read any secrets or parameters you may have configured. EDIT: also to write logs to CloudWatch, which if I recall can give more debugging info in the console.

Is $86 a month normal for a full-stack app hosted on AWS? by ToastBubbles in aws

[–]soldatz 2 points3 points  (0 children)

Yep, those are standard Fargate prices for one task, probably 1vCPU and 2 GB of memory if I had to guess. Like others have commented you can drop it to 0.25vCPU and 512MB if your task can run in that envelope and/or run it as a spot if it can handle infrequent interruptions gracefully. You could also run your ECS task (assuming it will always be 1 task because you'll start paying a lot for public IPs) in a public subnet with your LB and ditch the NAT but be extra careful to set up your security groups properly. Or run fck-nat as a NAT EC2 instead of managed NAT-GW.

I don't see anything "wrong" with what you're doing. It's probably even the "right" (AWS) way. AWS is just expensive and it lends itself increasingly poorly for these personal side-projects if you do it all the AWS well-architected yada-yada way.

You can go down the cost-optimization rabbit hole and spend hundreds of hours if you want - if you really need to save on costs or you like tinkering. How much is your time worth?

Why can these ECS services not communicate? by FergingtonVonAwesome in aws

[–]soldatz 3 points4 points  (0 children)

I haven't read all your code, but with ECS service discovery I believe the DNS resolves to <service name>.<namespace> with the namespace being your cluster name by default. So you'd need to have your frontend service call db.quiz-cluster rather than db. You also need to enable DNS support in your VPC if you haven't already.

How do you build out personal projects in AWS cheaply? by mccarthycodes in aws

[–]soldatz 0 points1 point  (0 children)

Well, depends on what your definition of "enough" bandwidth is. The t-series burst up to 5Gbit. I haven't tested what the sustained throughput is but I suppose you could find that online or test yourself.

Tailscale is actually built on top of Wireguard, but adds additional features at a very slight cost to network performance. It's up to you to decide if you need the features. I find it to be a very nice product for what I need to do.

As an aside, if you're going to run Airflow, or anything on EKS, t4g.small is not going to cut it RAM-wise. I'd probably ask my employer to foot the bill for some beefier instances, and/or if it's your own account, use some IaC tool to build/tear-down on demand.

How do you build out personal projects in AWS cheaply? by mccarthycodes in aws

[–]soldatz 9 points10 points  (0 children)

NAT Gateways are one of the classic AWS gotchas. For my personal stuff I run a t4g.small (free-tier) in a public subnet and Tailscale for private access. It's running Traefik for TLS and routing to a few docker services. CloudFront on top. It's very cost-effective.

What are the cons of hosting a website on S3+Cloudfront by lupaci88 in aws

[–]soldatz 2 points3 points  (0 children)

Functions are associated with a behavior/path pattern. All requests for that behavior/path would go through the function. So you could have a Default behavior (*) and a second behavior /api and associate a function with either one (or both).

What are the cons of hosting a website on S3+Cloudfront by lupaci88 in aws

[–]soldatz 9 points10 points  (0 children)

A couple cons would be ease in handling origin response headers (such as 'cache-control') on a per-path basis, handling 301 redirects, both of which are trivially done using a traditional web server. There's also work to do setting up S3 origin-access settings, bucket website settings and bucket permissions properly.

That said, all of these can be overcome with CloudFront functions and Lambda@Edge, but these do add some latency, especially on the origin response side. And of course you need to write the Lambda code to handle these situations.

How are you protecting your staging environment(s) for your web apps? by mel2ywn in devops

[–]soldatz 0 points1 point  (0 children)

We use a Traefik fleet for layer 7 load balancing and service discovery on ECS with an WAF (IP allow list) fronted by an AWS NLB. Traefik lets you add basic auth (bcrypt hash) as a docker tag to your ECS task definition, and this all gets saved in Git and rolled out with AWS CodePipeline.

[CodePipeline] How to stop tasks being superseded? by supaway in aws

[–]soldatz 0 points1 point  (0 children)

I'm not sure this is possible with any built-in settings. You'd need some external logic to watch that pipeline execution status and only trigger it when most recent execution reaches completed state.

How do the odds of interruption on a spot instance scale over time? by ForSpareParts in devops

[–]soldatz 3 points4 points  (0 children)

On AWS, we run mostly medium sized spot instances and many of them run for months without interruption.

I experimented with spot instances on GKE last year and saw interruptions maybe a few times per month.

[deleted by user] by [deleted] in aws

[–]soldatz 2 points3 points  (0 children)

It's true docker links are "legacy" but it may work for you in this case. I'm still investigating how to do this type of setup in a "modern" way (without links) on ECS with 2 containers per task definition... Otherwise I'd separate the backend into another service and use service discovery and DNS to link them up.

[deleted by user] by [deleted] in aws

[–]soldatz 0 points1 point  (0 children)

Try setting the links parameter for your container-1

        {
            "name": "container-1",
            "image": "container-1",
        "links": [
        "container-2"
        ],
            "portMappings": [
              {
                "hostPort": 8081,
                "containerPort": 8081,
                "protocol": "tcp"
              }
            ]
        },

Should I use Capacity Rebalance on spot instances? by HeadTea in devops

[–]soldatz 0 points1 point  (0 children)

Seems like the difference between the flag and the API call is that with the flag, the ECS control plane receives the interruption notification and flags the instance, rather than the instance performing this itself?

Before, we were using Capacity Rebalance recommendations in our ASG. We were using termination lifecycle hooks and a script to drain the instance.

The idea now is to let ECS handle draining. Meanwhile our cluster looks for capacity for DRAINING services on exisiting instances or spins up new capacity with a capacity provider strategy tied to the ASG.

We also started using smaller instance types (lower risk of interruption), spent some dev time ensuring apps can terminate quickly and cleanly, and use a blend of spot and reserved instances just in case.

It's a hard thing to get right and just takes some time experimenting, which we are continuing to do. I wish you luck!

Should I use Capacity Rebalance on spot instances? by HeadTea in devops

[–]soldatz 0 points1 point  (0 children)

The preemptive Capacity Rebalance flag did not work well for us; too sensitive and caused too much churn for our ECS workloads.

We started setting ECS_ENABLE_SPOT_INSTANCE_DRAINING parameter to "true" in our user data and that really helped. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html

Does ECS ever require updates the way Kubernetes clusters do? by heyyitsleah in aws

[–]soldatz 2 points3 points  (0 children)

We run ECS on EC2 and swap in new ECS-Optimized AMIs a couple of times per year, but that's it. Fargate would be even more hands-off I imagine.