AWS Copilot
aws.amazon.com
aws.amazon.com
Does anyone have good suggestions in this space? Or do I just have to google docs and reference documentation when I need to figure out what the hell all these parameters mean?
Employees there usually don't have depth of technical expertise or experience to draw from, and are incentivized to make the product sound as easy to use as possible.
This combination results in {really complicated thing} -> {simple abstraction}. Ultimately, everyone internalizes this and starts forgetting that {simple abstraction} is actually {really complicated thing}.
Happens with any popular technology. Networking, DB, cloud, ML.
Unfortunately, this flies because the primary buyers are also non-technical.
I'm not a dev by any stretch of the imagination but deploying PHP apps on servers was significantly easier than this mess we have now.
Especially since there is no IDE support.
I've come back to enjoy XML with nice schemas and IDE validation and autocompletion instead of YAML and liquibase changes not going through properly due to an indention problem.
The domain is not simple enough for that, so you end up with all kinds of weird scripts around it all, or other templating/codegen solutions, plus all kinds of ad-hoc conventions that are extremely easy to break and very annoying to navigate.
Having a full blown statically typed language like TypeScript - where things can reference each other strongly (not just by names and other strings), naming conventions can be encoded in functions (or even enforced by types), and structures on every level (even your project-specific ones) have a well-defined and checked schema - would help a lot in my opinion.
Maybe deno could find a use in this niche.
I was picturing something more low level and less opinionated, though I can only guess how such a thing would perform in practice.
Not even necessarily a specific product, just the adoption of workflows that use already existing tools (e.g. the various API client libraries - for AWS, Kubernetes, git, docker registry, etc.) to achieve this. I realize that that could lead to reinventing the wheel, and eventually an in-house framework anyway, but it feels a lot more comfortable to start there, as you can design things closer to your exact needs.
Pulumi definitely looks interesting though.
I find using AWS without Terraform to be nearly impossible.
Cloudformation as a JSON/YAML vanilla config is just awful, and really exposes the inconsistancies between the different services.
I see very little practical value in a DSL like this. Using an existing language with an extensive ecosystem and great tooling was half the point of wanting TypeScript in the first place. Most of the "risks" can be handled with just a few eslint rules, tests (e.g. all outputs must satisfy a set of constraints), and code review.
Especially when the moment you need to do more than just generate config files (e.g. fetch some information from an external service, or even write an imperative script for the occasional task), you'd have to switch to a different langauge and all its tooling - where you can't just import the exact same type definitions, etc.
I don't know all the options, and I don't need to either. Can look at examples to get started and customise as I need. What changes?
Idk if other ways are better, just looking at large text config files for apache or other linux software boggles my mind just as much if not more. Once you have lots of options it's just going to be complex to understand.
There are tools to catch and prevent that sort of thing: Datree, AWS CloudFormation templates, and Sentinel, just to name a few. They apply and enforce different policies to prevent YAML/JSON (or “infrastructure as code”) misconfigurations.
(Disclaimer: I work with Datree, but not the others.)
20 years ago I was a Windows admin, discovered Linux, and it blew my mind how much easier it was to configure, experiment, validate, and roll-back config changes. GUIs are nice for discovery and exploration, but there's a very good reason they're not used for server and infrastructure configuration.
We learned this lesson the hard way with XML back in the early naughts when behind everything was a nauseating morass of xml with overcomplicated designed-by-committee schemas.
People moved out of development and tried hard to forget it, but neglected to instruct the next generation about the pitfalls of shitty configuration files that get out of control.
Now we got json and yaml. No more </>'s, yay, but somehow worse, less maintainable and less understandable.
The arguments for k8s I have is that the local and production setups are identical.
It's a PITA to run k8s locally, but the alternative is that you use Docker Compose local, and then deploy to k8s, which means two sets of configs. And that's terrible.
Or, you use Docker Compose locally, and fragment all of the containers into individual ECS/Fargate services which you write the deploy pipeline for individually.
These were your best options, for one glaring reason: You can't use a docker-compose.yaml in production. (I know, I know, Kompose, but it doesn't always work quite right and you now have a k8s cluster).
Really excited to try this out, thanks for the work on it!
For similar tools (though this one is ECS + Fargate), also see:
https://somanymachines.com/fargate
https://github.com/awslabs/fargatecli
I'm pretty particular to Pulumi, and defining infra in typed programming languages with full IDE tooling. AWS CDK is the AWS-centric equivalent, and that's a great and under-represented tool as well IMO.
https://www.pulumi.com/containers/
https://docs.aws.amazon.com/cdk/latest/guide/home.html
My issue with ECS/Fargate is that on the surface, it seems amazing. And so you deploy your container, and that's relatively easy.
But now you have just a container on HTTP, on a bare IP. You probably want HTTPS and a domain name attached.
So then you learn that you need to:
- Create a Route53 hosted zone for the domain
- Use AWS Cert Manager to provision certificates for the domain
- Create a load balancer, and figure out how to attach it to the ECS/Fargate service
- Wire up the LB address to the record set and configure the termination for HTTPS
And to do something like change an environment variable, you have to create an entirely new "task definition", deploy the task revision, and then spin up the new service and stop the old one. This takes about 5 not-particularly-easy to find or navigate screens in the AWS console.
This is what it ended up looking like, for me to deploy a Fargate service:
https://gist.github.com/GavinRay97/fbedfb18fe852bf625451a417...
It's great that these tools can help reduce the burden of doing this but man is it a painful experience if you're not a wizard at DevOps.
Google Cloud Run is 1-2 bash commands to deploy a containerized app on HTTPS.
https://github.com/aws/copilot-cli/wiki/Applications#additio...
I love the cloudrun style service too - but one thing I think is cool about running on ECS/Fargate is that once you outgrow the constraints of CloudRun style services - you can drop down to the more granular infrastructure to make tweaks and adjustments. Just my 2c :)
Oh yeah for sure! I was really excited about this for that reason when I found it because of recent Fargate pains.
The irrational part of me just wishes that the "magic" from tools that AWS publishes like Copilot, Cloud Development Kit, Fargate CLI, etc could abstract it away in more of my interactions with AWS ;^)
> once you outgrow the constraints of CloudRun style services - you can drop down to the more granular infrastructure to make tweaks and adjustments.
Definitely, you're trading convenience for flexibility with Cloud Run vs Fargate. Cloud Run also doesn't support websocket traffic yet ( RIP =/ ).
I'm a massive fanboy of Serverless Containers and think they're the best thing since sliced bread. I run services on both AWS and GCP, and think Cloud Run and Fargate are both solid.
My takeaway with AWS I guess is: Don't interact with provisioning/managing infra raw, use the CDK or other tooling you publish haha.
I've moved pretty much all my sandbox exploration to CDK. A one-shot destroy when I'm done to clean everything up is great. I also appreciate the documented types in Typescript. But beyond that, I've found that there's really no easy way to manage permissions manually. Doing ` bucket.grantRead(service.taskDefinition.taskRole);` is so much simpler than any of the policy generators in the aws console.
...which kinda proves your point. This stuff is not well documented and it's ever more complexity.
Quite often I want to strace, tcpdump, etc. Cloudwatch logs is a little anemic. Want to see an adjacent line in a log search? Good luck.
But it does sometimes mean that there's always just one more AWS service you need. One more service with a different web console UI, varied support in the different infrastructure tools... and now we have another one of those.
All I seem to do these days is AWS infrastructure, sometimes as code. I'm not sure one more new tool is going to improve that.
Homebrew: brew install aws/tap/copilot-cli
Docs: https://aws.github.io/copilot-cli/
Feedback & Requests: https://github.com/aws/copilot-cli/issues/new
Wondering if it’s possible to use this with our own self-managed ASG of ECS Host instances. I trolled through the GH repo quick, but couldn’t find any definitive answer.
1. Production and Staging in separate accounts 2. A new environment provisioned per github PR with setup/teardown - ideally within the same VPC/Subnet ranges, so they can utilise shared databases 3. Secrets stored in Secrets Manager or Parameter Store 4. Blue/Green deploys for production with a manual cutover step (manual step optional) 5. Deployment of 2 services (app, background tasks) from the same dockerfile/commit
1 Yeap! We can do that. 2 hmmm we don’t support this out of the box - but I’d love to know what you expect out of this. All your services spun up and infra? 3. Check! 4. No blue green deployments yet :( 5. Yea! We support this via a pipeline.
It’s written by some of the brightest people I’m AWS - so Don’t worry about that.
My question is a bit less targeted at this specifically and more about how AWS approaches all of these various tools.
We have probably 95% of our infrastructure in CloudFormation one way or another (either directly or with something like SAM).
As more of these tools come out there is going to be crossover (and there already is with Amplify and SAM for example).
There will also be questions about how we pass exports around so we don't have to hard code endpoints that were created by another tool. (Say a Lambda created by SAM needs to be called by a service in ECS).
So my question is a couple things:
1. Does AWS have a requirement or a goal in mind of how to always ensure we can pass these exports around ideally in a consistent way (this and any future tools that may come out)? I worry about having too many different ways that things work from a code standpoint that we just introduce more bugs into our system.
2. Is the thought that a given repo should ideally be using a single tool (I ask since I see you mention S3 buckets, and databases as a coming soon) and not mixing things? Like not using this plus some native CloudFormation for example?
3. Finally, I would love to see a... "deployment tools" page or something from AWS. A page that is a table of every deployment tool for columns and every service for rows and can easily see at a glance what tool can do which services. Right now I am considering if I need to build a page like this for internal use so a developer can easily look and see what fits their use case the best. But a page managed by AWS would be great.
Ultimately what I struggle a bit with tools like this, are what does it get me long term over just using straight CloudFormation where my only limitation is CloudFormation lagging behind.
I've been an AWS customer for over 10 years, and have been asking them for this (on behalf of my enterprise customers). I'm always told "they're working on getting better" but they never really do.
Cloud formation features are inconsistent across products. Documentation is formatted and structured differently depending on the tool. The AWS web console is an ever changing grab-bag of new and old. Some products integrate well, other products feel like you're using an abandoned hack-week prototype.
Part of the reason that AWS is so great is how much it can do, and I think that's been made possible by the apparent level of autonomy the teams have. However, it's at the expense of the customer's experience.
I guess its more, if I had to choose one area of AWS that I wish there was a but more consistency it would be their deployment tools. It really just comes down to, when I start something it's almost an agonizing choice of what do I use since I am worried that I could get stuck in a box.
I don't know what the answer is, that is just my view of all of these tools.
Thanks!
- It introduces an edit-test-debug cycle from hell, it doesn't do what you think from the mental model of a user-friendly CF template generator library (doesn't statically ensure stuff it emits actually works even superficially)
- It builds upon an already difficult and leaky abstraction (CloudFormation) so you just get additional failure modes and cognitive burden
- Glacially slow iteration, can easily take 10-30 mins to teardown/setup your app due to CloudFormation.
- fails to provide upsides from the costly tradeoff it makes to jump into turing complete programming languages, like 3rd party cdk components or iterating expressions at a repl
- don't even get me started on the npm dependency hell (you'll randomly be debugging mystic npm warnings already on the next day when installing a new submodule of cdk deps, when version mismatches appear), the other-languages-to-npm bridges, the "you can't use this without an IntelliSense style IDE" API design, buggy cli tools, etc
To summarize it doesn't manage complexity or give you a good abstraction. Probably because it tries to take on all of AWS functionality at once.
(Also the GP linked Fargate example is far from the functionality from the copilot example, like enabling you to actually dev and deploy the app - ecr, codebuild, codepipeline etc)
I think it’s different approach - that’s all. Copilot Is more focused around a full developer experience including setting up CI/CD, deployment environments and operational tooling like logs, stats, etc.
(Happy convox customer)
https://leebriggs.co.uk/blog/2019/04/13/the-fargate-illusion...
Summary: the marketing spiel about how easy fargate is to use and get up and running isn't actually how the experience is. I'm hoping Copilot improves that experience.
there was way too much magic going on and i wasn't confident i could easily roll back or do modifications if the CLI didn't like something in particular. deployments based on terraform or cloudformation were particular susceptible to this.