News for hackers. Stuff that matters.
Re:Does anyone else finds AWS and other Amazon services over... by gw98 on Sunday November 06, 2022 @05:10AM (#33491010)
Ah that's nothing. Simple problem from a high level: static web site on apex domain.

What you should be able to do:

Click click done. Upload files to S3. Point CNAME at AWS.

What you have to do:

Create an S3 bucket and stick the files in it. Create a zone in Route 53 and import your old zone file. Change your nameservers at the registrar. Wait a bit. Go to ACM in the correct region and create a cert. Tell it to add the DNS entries to R53. Wait a bit. Create a CloudFront distribution making sure that you get all the options right which is quite difficult. While that's deploying, copy the IAM policy it generates back to the S3 bucket. Jump back to R53 and add a new A record pointing at the cloudfront distribution alias. Cross fingers and start praying that the whole stack works. If it doesn't spend several hours working out which thing you forgot to click.

What devops culture would have you do:

Play with CloudFormation for 2 days writing oodles of mind numbing YAML and realise that you have to create the ACM cert and CF distribution in a different region to your bucket but that's impossible. Try and work around this with recommended StackSets but realise they are so horrible that they are unusable. Spend an hour googling. Download terraform because everyone is gushing over it. Spend several hours learning the above and writing it in HCL constantly tearing down and creating resources until the whole thing limps along. Eventually realise you need to share this is someone and the thing is stateful so pay Hashicorp for TF Cloud. After the PO is approved with takes 2 weeks, check it in to git, cheer loudly, hand it over to a colleague who has a different version of terraform and then discover about tfenv and terraform upgrades.

I only do this because I'm paid by the hour. I'm not even a cloud or ops guy. I'm an electronics engineer who needs to eat. I eat well due to this mess but I know it's all so so so wrong.

Re:Does anyone else finds AWS and other Amazon services over... by quickthrower2 on Sunday November 06, 2022 @05:37AM (#33491172)
I prefer log into Hostgator, click cPanel, click File Manager, drag files across. Any day!

Ok I missed: point DNS to Hostgator name servers. Click the button to install lets encrypt.

Re:Does anyone else finds AWS and other Amazon services over... by spaniard89277 on Sunday November 06, 2022 @07:53AM (#33492049)
Yep, I just opload to my FTP from my file browser (thunar), not even cpanel. I use picocms so can't be easier to manage.
Re:Does anyone else finds AWS and other Amazon services over... by gw98 on Sunday November 06, 2022 @08:34AM (#33492442)
You know it's bad when cPanel is a less painful solution :)
Re:Does anyone else finds AWS and other Amazon services over... by YPPH on Sunday November 06, 2022 @05:20AM (#33491064)
>Go to ACM in the correct region and create a cert

Glad you included the "correct region" qualifier. The number of times I've mistakenly created th certificate in my local region, rather than the one designated for S3...

Re:Does anyone else finds AWS and other Amazon services over... by gw98 on Sunday November 06, 2022 @05:23AM (#33491089)
Yep.

Really these days I want to solve the problem and go home, not remember where the poo I stepped in last time I had to solve it was.

Re:Does anyone else finds AWS and other Amazon services over... by kureikain on Sunday November 06, 2022 @05:41AM (#33491195)
to add salt to the wound, there is a certain service you have to use and provision on us-east-1...such as cloudfront...where you already had the same ACM cert in us-east-2.
Re:Does anyone else finds AWS and other Amazon services over... by zoover2020 on Sunday November 06, 2022 @05:16AM (#33491051)
Are you aware of the AWS CDK?

Doing that in Infra as Code shouldn't take two days IMO.

Re:Does anyone else finds AWS and other Amazon services over... by gw98 on Sunday November 06, 2022 @05:21AM (#33491074)
Yes. CDK is just another way of expressing the same things as terraform and cloudfront but using a framework which is opaque. Plus it's slow as fuck, buggy and difficult to debug when it goes wrong.

Every attempt keeps trying to solve the same problems with a new abstraction but the problem is the underlying abstraction not the tools.

Re:Does anyone else finds AWS and other Amazon services over... by cube00 on Sunday November 06, 2022 @06:59AM (#33491675)
This is what worried me when I see the marketing claiming how easy is it run up infra using AWS SAM. It's all great until something goes wrong and you have to peak behind the curtain to the nest of automatically generated Cloudfoundation scripts.
Re:Does anyone else finds AWS and other Amazon services over... by Hawxy on Sunday November 06, 2022 @07:04AM (#33491708)
> CDK is just another way of expressing the same things as terraform and cloudfront but using a framework which is opaque.

It also involves writing many, many less lines of code than Cloudformation/Terraform thanks to the excellent abstractions it bundles in. Your example of writing "2 days' worth of YAML" is less than 120 lines of Typescript in CDK. You could even skip that and just npm install the AWS solutions construct for this scenario if you have literally no idea what you're doing: https://docs.aws.amazon.com/solutions/latest/constructs/aws-...

Re:Does anyone else finds AWS and other Amazon services over... by gw98 on Sunday November 06, 2022 @07:19AM (#33491806)
We don’t know typescript. So we’d have to learn that first.
Re:Does anyone else finds AWS and other Amazon services over... by Hawxy on Sunday November 06, 2022 @07:36AM (#33491909)
CDK also works with Java or Python.
Re:Does anyone else finds AWS and other Amazon services over... by indymike on Sunday November 06, 2022 @07:27AM (#33491849)
Do you know JavaScript?
Re:Does anyone else finds AWS and other Amazon services over... by gw98 on Sunday November 06, 2022 @08:22AM (#33492324)
Nope!

Edit: not strictly true. I know JavaScript quite well but I wish to have nothing whatsoever to do with it and the ecosystem around it due to a number of reasons I would have to write a whole essay on.

Re:Does anyone else finds AWS and other Amazon services over... by irjustin on Sunday November 06, 2022 @08:20AM (#33492287)
To be absolutely fair the CDK is non-trivial.

If you know CloudFormation, you do _not_ know the CDK. The CDK is split in 3 versions, ver 1, ver 2 and v2-alpha. Knowing the difference between L1, L2 missing options between the two.

Don't even get me started on docs. Docs in CloudFormation is KING. CDK's docs are a simplification at BEST. Most of the time I have to drop down into CF's docs to see what the actual constraints on a key are.

Given all my complaints, I'm not going back to CloudFormation. It is wayyyyy less code. Separated files. And, it's too hard to do complex stuff in CF. CDK has a lot of nice magic that takes away so much complexity esp dealing with cross region work.

Re:Does anyone else finds AWS and other Amazon services over... by indrora on Monday November 07, 2022 @02:18AM (#33502265)
Hi, I work on (part) of the CDK at the moment. If you've found bugs, we'd love to hear about them with an appropriate reproduction over on github[0].

Thus ends my corp-speak. The following is my opinion alone:

The thing that is hard for a lot of people to understand, it feels like, is that the CDK is both a library (nee runtime) and CI system in one. The runtime produces, at the end of the day, a CloudFormation template that gets shoved into the right places. The CDK happens to make generating those easier.

One of the core issues with working with CloudFormation is that it's limited in what the services support it doing. Services introduced before CloudFormation was really launched have the worst, but it wasn't until 2015 or so that most services really had "OK" support for CFN. CloudFormation is also brittle, and this causes a lot of headaches.

CloudFormation can't handle serial operations that require "create & permute" sequences -- where two things have to be set up in order, then glued together later after some kind of configuration. The way the CDK does this is by deploying lambdas that get invoked after your stack is shipped out that make the relevant API calls. Terraform does this by having the code that Terraform runs make the API call. The difference here gets to be that the CDK can synthesize a change long before it is actually effected, allowing for things like second order permutations. Terraform does everything in-situ, standing up infrastructure and taking the place of both the CDK and CloudFormation.

This has upsides and downsides on both, but a large upside (IMO, again) of the CDK approach is that you can code-wise validate certain things ahead of time before they're deployed, whereas with Terraform it's a little harder. Terraform's big upside is that it handles things that are Hard to do with CloudFormation alone by letting you figure out how to actually create/destroy that bit of infrastructure and hook up the relevant parts as one action in one codebase, rather than having to write Lambda handlers (the CDK calls these handlers "Custom Resource", which are different from Constructs) that get deployed and called when you need to setup/teardown/change the relevant parts.

Both Terraform and the CDK are opaque wrappers around AWS as a whole, the difference being that Terraform wrote their own DSL to describe things that gets then attached to their own SDK (which appears to be JS?) with varying levels of integration, whereas the CDK allows you to use whatever language you're already using to build the primary structure of your application, but where you have fully atomic (not just rollback-able) changes via CloudFormation.

[0]github.com/aws/aws-cdk/issues/new

Re:Does anyone else finds AWS and other Amazon services over... by viraptor on Sunday November 06, 2022 @06:57AM (#33491658)
AWS is basically a "construct your own custom infrastructure" service and does that well. But if you're not going past a static page, it's not the best service - just go with vercel or netlify or someone similar instead.

The policies, cloudformation, r53 config, cloudfront all have their purpose and a lot of flexibility. But don't pay the complexity price if someone else can wrap it for you in a nice saas.

Re:Does anyone else finds AWS and other Amazon services over... by yakubin on Sunday November 06, 2022 @07:19AM (#33491804)
100% this. A couple times I've considered moving my personal website to AWS, but each time I got lost in the documentation trying to keep all the different moving parts in my head. At the end of the day managing a single VPS running debian+nginx+certbot[1] with a Gandi domain is orders of magnitude simpler.

[1]: I'm probably going to move that to FreeBSD/OpenBSD with OpenBSD's relayd+httpd+acme-client at some point, but the general idea stays the same.

Re:Does anyone else finds AWS and other Amazon services over... by devonkim on Sunday November 06, 2022 @10:06AM (#33493363)
AWS / systems professional here. I’d use something like Netlify for a personal site instead of the complexities and knobs available when using AWS S3 static site options. AWS bare is the equivalent to me of trying to use Linux From Scratch in 2012 for running a bash script in a cronjob when there’s distributions like Ubuntu out there meant to do a lot of the boring and mostly inconsequential stuff for everyone besides the highly regulated. It’s great for educational reasons but learning and productivity are usually diametrically opposed in use cases.
Re:Does anyone else finds AWS and other Amazon services over... by philliphaydon on Sunday November 06, 2022 @08:17AM (#33492266)
I learned cloudformation in a day. Everyone on HN said use terraforms. Tried to learn terraforms and it made things complicated. Went back to CF.
Re:Does anyone else finds AWS and other Amazon services over... by laputan_machine on Sunday November 06, 2022 @08:23AM (#33492332)
I'm currently in the middle of converting my team to straight CF instead of CDK/Terraform/Serverless. To me it's needlessly complicated, CF is simple, configurable, importantly it's _declarative_, which is the 'correct' way to approach infra (imho, of course).

Deploying it? `aws cloudformation package -> aws cloudformation deploy`. That's it. No need for third party tooling or other madness.

I think the lack of understanding the fundamentals leads people to picking up tools that abstract the fundamentals away (but then leads to more complex solutions).

Re:Does anyone else finds AWS and other Amazon services over... by sgarland on Sunday November 06, 2022 @09:32AM (#33493010)
The thing is, Terraform is the industry standard, for better or for worse. Much like Helm for Kubernetes (or Kubernetes, for that matter). If you go somewhere else, the expectation is probably that you know how to use those.
Re:Does anyone else finds AWS and other Amazon services over... by stblack on Sunday November 06, 2022 @08:20AM (#33492291)
I envy you.

I am using a simple S3 bucket to serve image files.

We’re getting close to busting the free tier web traffic limit.

I can’t figure out where, or how, to enter my boss’s credit card so we can start paying for the service.

I’m not kidding. I’ve looked everywhere. Several times. I’ve probably spent two hours on this.

Re:Does anyone else finds AWS and other Amazon services over... by pooper on Sunday November 06, 2022 @08:26AM (#33492362)
How can you even get started with AWS without entering payment details? I would love to use AWS for personal projects if I could guarantee it will just stop service outright I stead of charging me.
Re:Does anyone else finds AWS and other Amazon services over... by gw98 on Sunday November 06, 2022 @08:33AM (#33492435)
I've done contract work for a couple of large enterprises. It's amazing how many AWS accounts are just floating around out there on a corp credit card that no one knows who added it and when it's going to expire.
Re:Does anyone else finds AWS and other Amazon services over... by e40 on Sunday November 06, 2022 @08:25AM (#33492352)
Sounds like you don’t have billing credentials for your iams user.
Re:Does anyone else finds AWS and other Amazon services over... by vitorfhc on Sunday November 06, 2022 @08:25AM (#33492354)
Hey, is the AWS account you are using inside an organization? If it's then all the billing information should go into the management account. Hope this is the issue and I could help you.
Re:Does anyone else finds AWS and other Amazon services over... by TheLoafOfBread on Sunday November 06, 2022 @08:57AM (#33492676)
Exactly this.
Re:Does anyone else finds AWS and other Amazon services over... by stblack on Sunday November 06, 2022 @12:27PM (#33494968)
Here's how this is playing out.

* We need a way to serve image files.

* I create an organization account, add an S3 bucket.

* We serve images as our application grows.

* Fast forward a few months, get an email saying, we're at 85% of free-tier limit.

* I invite my boss to the Organization, and make her the financial contact.

* Neither I, nor my boss, have been able to figure out where, or how, to enter a credit card number.

* We continue to get monthly 85% limit emails. Following the link in the email leads nowhere where we could enter the payment info.

* What a completely insane and stupidly opaque UI. Take our money! How?

* Will probably move to a service that's better organized. We're just serving image files, a few hundred per day.

We have both tried and are unable to figure out how to tie payment info to our AWS organization.

Re:Does anyone else finds AWS and other Amazon services over... by TheNewsIsHere on Sunday November 06, 2022 @10:49PM (#33500912)
Are you logging in with an Administrator credentialed account _in_ the Organization master account?

Did you give your boss a Billing role in IAM, within the Organization master account?

If so, search for the “Billing” service and Payment Methods will be on the side.

If in doubt, use the root account, but do so only sparingly. You can use it to debug admin and billing permissions.

Re:Does anyone else finds AWS and other Amazon services over... by kruuuder on Sunday November 06, 2022 @08:49AM (#33492600)
I also used an S3 bucket for static files. The setup was way more complicated than I expected, and figuring out how to get usage statistics and understanding the cost structure even more so. In the end I moved from S3 to a CDN, super simple to set up and costs went down from 200 USD per month to 5 USD per month. I hope I'll never have to deal with AWS again.
Re:Does anyone else finds AWS and other Amazon services over... by appleflaxen on Sunday November 06, 2022 @09:44AM (#33493125)
which CDN are you using?
Re:Does anyone else finds AWS and other Amazon services over... by kruuuder on Sunday November 06, 2022 @05:44PM (#33498300)
bunny.net
Re:Does anyone else finds AWS and other Amazon services over... by flamebreath447 on Sunday November 06, 2022 @10:34AM (#33493671)
Ah I see you haven’t spent countless hours looking at the management console cost breakdown because management says “our cloud spending is too high”, to then read the highest cost is your “cost savings plan”.
Re:Does anyone else finds AWS and other Amazon services over... by lifebeyondfife on Sunday November 06, 2022 @08:25AM (#33492353)
I created a CloudFormation script specifically to do this (including CloudFront for CDN). Yes, there's reasonable complexity, but it's a trade-off of security and configuration. As others noted, the documentation is good, and this took me a weekend to write including learning CloudFormation from scratch.

https://github.com/lifebeyondfife/simple-static-website/netw...

Re:Does anyone else finds AWS and other Amazon services over... by fhfuewidxjhe on Sunday November 06, 2022 @08:46AM (#33492576)
best part about debuging you HCL/CL is when you cannot delete some resource and it won't tell you why besides "is in use".

I created account after account at first and then had hell deleting them entirely. was still easier than figuring out was using a vpc that had nothing visible attached to it

Re:Does anyone else finds AWS and other Amazon services over... by hdjjhhvvhga on Sunday November 06, 2022 @11:55AM (#33494574)
> I eat well due to this mess but I know it's all so so so wrong.

That's the point - I do this too. I like the fact that AWS jobs pay well. I'm fair and I always point out to my clients that AWS is expensive and it will cost them more in the long run, and the vendor lock-in is considerable - but they don't care as "everybody is doing it." Well, that's fine with me, I also like to eat well.

Re:Does anyone else finds AWS and other Amazon services over... by TheNewsIsHere on Sunday November 06, 2022 @10:45PM (#33500883)
I recently created a static site at a zone apex without Route53. Everything else just works, well, as you illustrate.

> Play with CloudFormation for 2 days writing oodles of mind numbing YAML and realise that you have to create the ACM cert and CF distribution in a different region to your bucket but that's impossible.

The discrepancies in cross-region support specifically with ACM drives me nuts.

I noped away from Terraform back in 2019. At the time, the state management component was too immature, and it was a little.. lose with credential security.

You may like Ansible far more if you’d like something a bit more declarative, readable, and with “batteries included.” I have a close friend who is an EE and he finds tools like Ansible much more intuitive and enjoyable than Terraform and CloudFormation.

Every tool has its master.