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
New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Docjowles posted:

I'm trying to script against the Azure APIs for the first time, starting out with Python since that's my go to.

Why are you going against the api and not using bicep or terraform?

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Docjowles posted:

I don’t know what bicep is. Is there a terraform resource for “run an arbitrary billing query on demand”?

I don’t think what I’m doing is insane at all in AWS. Cost Explorer has a very easy api for exactly this. But this is my first real exposure to Azure

Just checking that you're using the right tool for the job. API is probably correct.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

The Iron Rose posted:

What systems do people use for automated semantic versioning of repositories? This is a general thing - it can include everything from docker images, to terraform modules, to CI/CD templates, to the actual codebases for our services (mostly python within my SRE/devops group, JS/Python/Golang for the rest of our org).

We use Gitlab, and I've got an engineer who's presented me a custom solution that you can include in a pipeline, but I'd rather use something off the shelf like commit-analyzer or GitVersion instead.

Thoughts?

I just use gitversion. It's fine, it gets the job done and doesn't require any hand holding once you get it set up which takes like 15 minutes.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug
What's the pattern for handling provider versioning within Terraform modules?

Let's say I have module A that is consumed by base. base says it needs provider version ~> 3.0. A says it needs provider version >= 3.0.0. They both have lock files that point to the same version, 3.5.

I upgrade base from 3.5 to 3.8. base immediately breaks because Module A is on 3.5. base can't simultaneously use 3.5 and 3.8. Is the trick to simply exclude lock files from version control for modules? That seems very wrong.

[edit] let's say that module A is being sourced out of a Git repo reference to a tag, not anything fancy like Terraform cloud.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Vulture Culture posted:

I believe the lock files for everything except the root module are irrelevant and are ignored, and only the constraints are considered when evaluating provider versions against modules

That's not the behavior I'm encountering, although it would make sense. I'll come up with a coherent example later.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

The Fool posted:

Even if lock files are parsed outside of the root module, you shouldn't use them anywhere else.

So lock files should only be in root modules? Then how do you handle

root module -> something that was originally also a root module but now is being used as part of a larger initiative but is also still a root module in some cases -> true, non-root module?

[edit] For what it's worth, I'm trying to reign in people who are attempting to over-module things but I'm not having a ton of success.

New Yorp New Yorp fucked around with this message at 00:15 on Jan 26, 2024

Adbot
ADBOT LOVES YOU

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

The Fool posted:

you don't

module management is poo poo and having more than a single layer of modules just increases that poo poo exponentially

the "right way" would be to break up your old root "module" into one or more consumable modules and never nest them

Agreed and thanks for the advice. I'm desperately trying to convince people that making a separate opinionated module for every single resource is a god-awful idea but I'm not getting any traction.

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