Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Fortunate Bird
Sep 3, 2011

Comb Your Beard posted:

First time poster ITT, this is both an aws question and noSQL question, let me know if not appropriate.

Our dynamo design, our PK is an id unique to our data, it's a carriers database, the carrier_id. The SK is the epoch second but we overload it and sometimes store other strings in it for different types of data. But always the int carrier_id for the PK.

We have sometimes run into collisions where an event happened the same second for the same carrier. Some may be dupes in our source data (MySQL) but some could be legit same second different data. How do developers handle something like this? I have some ideas but I want to ask the experts. Our source data doesn't hold milliseconds.

Some data my boss wants to use a particular datetime field that frequently breaks down to a even times like :00 or :30 minute for the timestamp so this will be even more of an issue going forward.

You could have the sk be a string of
code:

epoch-sec#uuid
Assuming the epoch sec is a fixed number of characters it will still be sortable and now they will all be unique.

You could have each item have an attribute witch is a list of all things that have occurred during that second.

Both of these could also work with 30 second buckets, etc. A lot will depend on your query patterns.

Adbot
ADBOT LOVES YOU

kalel
Jun 19, 2012

can someone recommend a decent tutorial project for terraform and/or ansible that has a bit more complexity than "here's an ec2 that prints hello world"

The Iron Rose
May 12, 2012

:minnie: Cat Army :minnie:

kalel posted:

can someone recommend a decent tutorial project for terraform and/or ansible that has a bit more complexity than "here's an ec2 that prints hello world"

setting up a pihole in the cloud and make it HA with shared configs and blocklists using ASGs, spot instances, and EFS is usually my go to for the people I mentor. Add an ALB or NLB, monitoring with Cloudwatch, alerting and logging, and so on. Make it run in a container and use certbot and HTTPS for your internal domain. Restrict access to only your public IP of course so AWS doesn’t yell at you for running an open resolver, or set up a openVPN along with it with profiles for iPhone/android, computers, and so on. Configure DNS over HTTPS. Deploy your terraform and ansible with CI/CD using GitHub actions.

Lose the load balancer and you can do this all in the free tier.

jiffypop45
Dec 30, 2011

kalel posted:

can someone recommend a decent tutorial project for terraform and/or ansible that has a bit more complexity than "here's an ec2 that prints hello world"

Terraform up and running by oreilly has a lot of more involved examples later in the book. It's what I used to learn for my company.

Unrelated rant but does anyone at their company have issues getting people to use the loving terraform linter?

I put in a PR the other day and this guy from another org absolutely ripped apart the formatting and it was all the linter. This is exactly what linters are for. To prevent this sort of lovely pedantic bickering.

I was so pissed.

jiffypop45 fucked around with this message at 19:30 on Jan 28, 2023

luminalflux
May 27, 2005



Yes, we run tflint as part of pre-commit-hooks for the repo. We also run pre-commit in CI on all our repos to ensure that someone doesn’t miss running it. Branch protection in GitHub means that you need a PR to merge and checks must be green to merge.

Edit: we also use Atlantis to plan/apply so you don’t have to handhold people into their AWS setup

jiffypop45
Dec 30, 2011

luminalflux posted:

Yes, we run tflint as part of pre-commit-hooks for the repo. We also run pre-commit in CI on all our repos to ensure that someone doesn’t miss running it. Branch protection in GitHub means that you need a PR to merge and checks must be green to merge.

Edit: we also use Atlantis to plan/apply so you don’t have to handhold people into their AWS setup

I should look into that.

You will comply.

Or else. :black101:

BaseballPCHiker
Jan 16, 2006

The Iron Rose posted:

setting up a pihole in the cloud and make it HA with shared configs and blocklists using ASGs, spot instances, and EFS is usually my go to for the people I mentor. Add an ALB or NLB, monitoring with Cloudwatch, alerting and logging, and so on. Make it run in a container and use certbot and HTTPS for your internal domain. Restrict access to only your public IP of course so AWS doesn’t yell at you for running an open resolver, or set up a openVPN along with it with profiles for iPhone/android, computers, and so on. Configure DNS over HTTPS. Deploy your terraform and ansible with CI/CD using GitHub actions.

Lose the load balancer and you can do this all in the free tier.

This is a great idea!

Going to work on that in an upcoming weekend. I still run pihole on an old raspberry pi b that I worry is not long for this earth.

Docjowles
Apr 9, 2009

luminalflux posted:

Yes, we run tflint as part of pre-commit-hooks for the repo. We also run pre-commit in CI on all our repos to ensure that someone doesn’t miss running it. Branch protection in GitHub means that you need a PR to merge and checks must be green to merge.

Edit: we also use Atlantis to plan/apply so you don’t have to handhold people into their AWS setup

Yeah we actually do all of this stuff too. https://pre-commit.com makes sure various linters run before poo poo even gets committed, let alone to the code review stage. Pedantic assholes arguing about the number of spaces or whatever is such an obnoxious waste of time, just make a tool enforce it.

And I enjoy Atlantis too.

Docjowles fucked around with this message at 21:03 on Jan 28, 2023

luminalflux
May 27, 2005



Docjowles posted:

Yeah we actually do all of this stuff too. https://pre-commit.com makes sure various linters run before poo poo even gets committed, let alone to the code review stage. Pedantic assholes arguing about the number of spaces or whatever is such an obnoxious waste of time, just make a tool enforce it.

And I enjoy Atlantis too.

Yep, that’s the framework we use. You need to run it in CI as well, since people sometimes “forget” to install it in repos they don’t normally work with.

“Linters are failing. Please ensure you’ve installed pre-commit hooks on this repo with pre-commit install” is something I use as a “Request changes” review way too often.

kalel
Jun 19, 2012

The Iron Rose posted:

setting up a pihole in the cloud and make it HA with shared configs and blocklists using ASGs, spot instances, and EFS is usually my go to for the people I mentor. Add an ALB or NLB, monitoring with Cloudwatch, alerting and logging, and so on. Make it run in a container and use certbot and HTTPS for your internal domain. Restrict access to only your public IP of course so AWS doesn’t yell at you for running an open resolver, or set up a openVPN along with it with profiles for iPhone/android, computers, and so on. Configure DNS over HTTPS. Deploy your terraform and ansible with CI/CD using GitHub actions.

Lose the load balancer and you can do this all in the free tier.

sounds cool. is there a tutorial walkthrough you would recommend because I'm not smart/experienced enough to figure that all out on my own

Falcon2001
Oct 10, 2004

Eat your hamburgers, Apollo.
Pillbug

Docjowles posted:

Yeah we actually do all of this stuff too. https://pre-commit.com makes sure various linters run before poo poo even gets committed, let alone to the code review stage. Pedantic assholes arguing about the number of spaces or whatever is such an obnoxious waste of time, just make a tool enforce it.

And I enjoy Atlantis too.

Nthing this; pick a linter and force compliance in CI for basically any language; if folks want to argue about the right formats to use, agree as a team and setup your CI to use it (like PEP8 for Python says 80 char lines, but line lengths of 120 is perfectly reasonable. The rest of it should really be consistent with a given style guide used by whatever linter you're using)

duck monster
Dec 15, 2004

Question about AWS api service.

We're trying to integrate a fairly heavy pair of dockerized apis (One a fastapi with the ability to offload some fairly gnarly spatial transformations [multi-gig datasets] to a backend worker process) and a geoserver instance (giant ancient crusty java erver that wants a few gigs of ram and probably terrabytes of storage xto do its thing, oh and its start up time is a good 7-10 mins), with our lambda jumble. Obviously neither are good candidates for lambda-izing, which is fine, we've come to accept that short of rewriting the whole thing (including the very standard 3rd party geoserver, something beyond our scope) we'll have a bit of a hybrid setup.

So far so good.

One thing we want to do however is put the fastapi behind the AWS api front-end so it forms an effective singular api with the lambda stuff. The problem seems to be that attempting to load in the OpenAPI.json generated by FastAPI (which is a great little framework that heavily utilizes the static type annotations of the recent python 3.x's to build schemas) it wants to overwrite the whole setup. Thats obviously going to be a problem.

So I guess the question is, is there another way to do this? Can I just tell the api front end service to just redirect everything under a particular path to the service and yolo it, or perhaps have a secondary api front end feed into a primary one?

Whats the best practice here?

BaseballPCHiker
Jan 16, 2006

BaseballPCHiker posted:

Speaking of! I got tasked with tracking down Marketplace subscriptions, whose subscribing, why are they doing that, etc. And for the life of me I dont see any marketplace API calls in our CloudTrail. Looking at the reference I think I need to be searching for aws-marketplace:Subscribe but I cant find anything marketplace related. I verified our org CloudTrail doesnt have any exclusions.

Are these API calls some weird one off that doesnt get written to CloudTrail or something?

Confirmed! Buying poo poo from marketplace is not captured by CloudTrail. You can kind of find it digging around in cost explorer.

Twerk from Home
Jan 17, 2009

This avatar brought to you by the 'save our dead gay forums' foundation.
I just want to make sure I'm not missing something obvious in GCP GPU pricing: it looks like the best value is always latest gen GPUs, which tells me that the old ones are only kept around for customers who don't want to bother with the effort of moving onto newer instances: https://cloud.google.com/compute/gpus-pricing.

Is that a sane read of the situation? I know that's broadly how it works with CPU based instance type, but per-core CPU performance has been advancing so slowly it's less noticeable there, while pricing a Pascal GPU higher than a Turing one is just weird as hell.

Scrapez
Feb 27, 2004

Elastic Beanstalk instance security group question:

Trying to spin up EB in two different regions but want it to use a custom security group. I know I can add a securitygroup.config file to the .ebextensions directory of the application to tell it which security group to use like this:

option_settings:
- namespace: aws:autoscaling:launchconfiguration
option_name: SecurityGroups
value: sgEBSecurityGroup

The issue I have is that I'm deploying into VPCs so I need to specify the security group ID rather than the security group name. The security group ID is obviously different in each region so it would require me to have two different versions of the application with a different securitygroup.config within each. Is there a way to reference the region and select the corresponding security group ID that exists within that region?

Scrapez fucked around with this message at 21:16 on Feb 17, 2023

BaseballPCHiker
Jan 16, 2006

Anyone have that link for the alternate AWS status/health checks?

It was called something like Honest or True AWS health report? Ringing any bells for anyone. Cant for the life of me remember what it was called, but it was always way more accurate than the official AWS health status page.

The Fool
Oct 16, 2003


Thinking of lying.cloud? That was a quinnypig thing but he took it down a while ago.

BaseballPCHiker
Jan 16, 2006

That sounds right. Bummer, that worked pretty well. Any good alternatives?

jiffypop45
Dec 30, 2011

Wonder if he was just scraping Twitter. I've seen other companies do that for status pages with accurate results.

Hughmoris
Apr 21, 2007
Let's go to the abyss!
A question about IaC and version control:

Say I have a single-pay webapp that just says 'Hello' when you navigate to it. I want to host it on EC2 + nginx. I want to deploy it with Terraform. I want to use Github for version control and later on I might add pictures to the app.

Do I put my Terraform files inside of my Webapp github repo? Or is it good practice to host terraform files separate from the webapp it is building infrastructure for?

The Fool
Oct 16, 2003


put them in separate folders from the root

ie
/infra
/webapp

Hughmoris
Apr 21, 2007
Let's go to the abyss!

The Fool posted:

put them in separate folders from the root

ie
/infra
/webapp

Ok that makes sense, thanks!

The Fool
Oct 16, 2003


putting them in separate repos isnt a terrible idea either, but imo for smaller projects it just makes more sense to keep everything together

12 rats tied together
Sep 7, 2006

keeping them adjacent in the same repo is usually better in my experience, although i usually name the folder terraform/ instead of infra/

The Fool
Oct 16, 2003


I see it in larger projects that split microservices up into separate repos but they still share infrastructure so the iac config is in its own repo

Resdfru
Jun 4, 2004

I'm a freak on a leash.
Going against the grain to say I prefer my IaC code to be in its own repo. Especially if there are more people than you touching it/the app. It's related to the app but it's also got nothing to do with the app, if you know what I mean.

But that's just like, my opinion, man.

freeasinbeer
Mar 26, 2015

by Fluffdaddy
I find that folks also get tied up in git semantics around PRs and workflows a lot and that can mean some really awkward workflows if they share a repo.

jiffypop45
Dec 30, 2011

One iac repo per microservice. Anything more will drive you insane and doesn't scale. We currently have this guest engineering team at my job that stuck like 3 microservice worth of iac in a single repo and when I submitted a 1500 line cr for it absolutely screamed at me. So we shelved my cr and are just going to wait until they go away and then merge it.

(Rewriting peoples tf code to be idiomatic doesn't make friends but they could have read the book the same as me but elected not to so they don't have anything to stand on, as noted previously I'm sticking that tf linter on our hooks as soon as I get back from leave)

FormatAmerica
Jun 3, 2005
Grimey Drawer
Pulumi seems pretty cool and seems to have some neat usability benefits over tf like interactive debugging, I think I'll give it a shot w/ a new project sometime soon.

https://www.pulumi.com

freeasinbeer
Mar 26, 2015

by Fluffdaddy

FormatAmerica posted:

Pulumi seems pretty cool and seems to have some neat usability benefits over tf like interactive debugging, I think I'll give it a shot w/ a new project sometime soon.

https://www.pulumi.com

I’ve heard folks saying it doesn’t live up to hype lately.

jiffypop45
Dec 30, 2011

Terraform cloud does a lot of the same stuff but market share is still a bit limited.

Adhemar
Jan 21, 2004

Kellner, da ist ein scheussliches Biest in meiner Suppe.
CDK for life.

Bhodi
Dec 9, 2007

Oh, it's just a cat.
Pillbug

freeasinbeer posted:

I find that folks also get tied up in git semantics around PRs and workflows a lot and that can mean some really awkward workflows if they share a repo.
Also, a lot of your ci/cd stuff expects a single file to be in a specific place per repo (Jenkinsfile in the root, for example) which doesn't mesh if you've got various deployment tasks all pointing at the same repo.

Woof Blitzer
Dec 29, 2012

[-]
Does anyone who works at Amazon ITT work on the ADC team?

jiffypop45
Dec 30, 2011

Woof Blitzer posted:

Does anyone who works at Amazon ITT work on the ADC team?

I did for awhile what's up?

Woof Blitzer
Dec 29, 2012

[-]

jiffypop45 posted:

I did for awhile what's up?

Let's take this... to PMs!

xpander
Sep 2, 2004
What's the best way to get AWS credits for a startup? I've tried this before when starting my consulting company, but don't know what magic incantation will result in getting anything at all, let alone the maximum possible. Appreciate any sage advice from Amazon folk or other knowledgeable types!

Pile Of Garbage
May 28, 2007



You'd want to talk to an AWS TAM. From what I've seen, limited as it is, usually you need >5 figure spend (Plus Premium Support subscription) before you'll have an opportunity to get one and they'll be specifically assigned to you to manage your experience as it were. If you want that level of engagement without any spend then you'd need to be on the Partner Network or know someone in a TAM role at AWS. The role of a TAM is customer development so if you happen to know one they can provide avenues to on-boarding even if they aren't specifically assigned to support you.

Disclaimer: my experience in this area is limited and I might be big-time wrong.


Edit: see below, much better info.

Pile Of Garbage fucked around with this message at 19:28 on Mar 22, 2023

Arzakon
Nov 24, 2002

"I hereby retire from Mafia"
Please turbo me if you catch me in a game.
You won't get anywhere through support/TAM unless you have an Enterprise Support contract and by then you probably have a named account/tech resource assigned to you in addition to the TAM. The best a support ticket is going to do is get you connected to your account manager.

There are half a billion different programs that help startups with funding, the best possible paths are:
1 - Reach out to your account manager and ask about programs for startups. AWS Activate is the big one - but there are many more buckets an account manager can pull from depending on what your spend is and what it could be based on your architecture and potential customer growth.
2 - Look at the Amazon Partner Network if your startup has any co-sell/better together story (are your customers also likely to be AWS customers and therefore co-marketable?). Even if not, joining is free and will get you identified by a "Partner Development Rep" which is kind of another account manager contact but for moving through partner programs - some of which are focused on Startups. There could be more credits here, joint marketing dollars, etc.

Feel free to hit me up via PM if you don't have a support contact to ask who your account manager is. If you have any spend at all you are assigned to someone's territory and I can help connect the dots for you.

Adbot
ADBOT LOVES YOU

xpander
Sep 2, 2004
Thanks, that's really helpful! Right now we're pre-launch, and serverless dev environments don't exactly rack up the spend so we won't have an account manager any time soon. Very interesting re: APN as we're bootstrapping via consulting, so this might be applicable. I was kind of under the impression that these were "try out/launch your startup" credits, I didn't realize this was meant for organizations who already had significant operations.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply