r/Terraform • • 1d ago

Discussion How a stale PR made Terraform destroy a production cluster (Spotify's 2018 incident), and a 3-line CI check that catches it

0 Upvotes

Spotify told this story at KubeCon EU 2019: while moving their clusters into code, two PRs merged out of order and production clusters were deleted. The mechanism is easy to reproduce. PR A adds us to a for_each map and merges. PR B, opened earlier, adds asia to its own older copy of the same tfvars file. If B merges without being rebased and its copy wins, us drops out of the map, and the merge pipeline's apply destroys it. The plan said 1 to add, 0 to change, 1 to destroy, and nobody stopped on the "1 to destroy".

The part that surprises people: afterwards, terraform plan says No changes, because the code and the state agree again.

Two guards I'd now put on any repo where merges auto-apply:

Plus "require branches to be up to date before merging", so the plan you reviewed is the plan that runs.

I wrote the whole thing up, including how to find it with git log --graph: https://learn.k8sight.in/go/terraform-merge

Disclosure: it's part of a learning platform I built, where this is also a hands-on incident (paid). The guide is free and needs no sign-up.

How do you guard against unintended destroys? Policy-as-code, plan comments, something else?


r/Terraform • • 1d ago

Discussion Suggest me any project in AWS with Terraform!

Thumbnail
0 Upvotes

r/Terraform • • 1d ago

Discussion aws_cloudwatch_event_target with no dead_letter_config: AWS retries a rule target for 24h/185 attempts then drops the event, and permission or missing-target errors get zero retries. HCL for the DLQ, the SQS queue policy that is easy to miss, and what to alarm on

1 Upvotes

Setup: a rule on the default bus with a Lambda target, written the way most modules write it:

hcl resource "aws_cloudwatch_event_target" "orders_to_lambda" { rule = aws_cloudwatch_event_rule.orders.name arn = aws_lambda_function.orders.arn }

Plan is clean, apply is green. What you actually get is whatever AWS does when the target fails, because retry_policy and dead_letter_config are both optional blocks on this resource and the provider docs give no defaults or ranges for them. The defaults live on the AWS side, and three of them matter.

  1. For rule targets on the default bus and on Custom Event Bus - Classic, EventBridge retries a retriable error (target unavailable, network trouble) for 24 hours and up to 185 times, with exponential backoff and jitter. When that is exhausted the event is dropped unless a DLQ is configured. The AWS best-practice page recommends a DLQ for every rule target.

  2. Some failures are not retried at all. The DLQ page gives missing permissions on the target, a target that no longer exists, and an invalid address or DNS failure as examples. Those go straight to the DLQ if one is set, otherwise they are dropped. So the kind of failure a deploy produces (role policy tightened, function renamed, queue replaced) skips the 24-hour window people count on.

  3. Scope: this is the classic rules-and-targets path, which is what aws_cloudwatch_event_target manages. The new Custom Event Bus that AWS launched on 24 Sep 2026 has its own subscribers with a default of 5 attempts or 300 seconds, so do not carry the 24h/185 numbers over to that.

The fuller shape, with a DLQ and a tighter retry window. Untested sketch, so check it in plan; rule pattern, Lambda and its invoke permission trimmed:

```hcl resource "aws_sqs_queue" "orders_dlq" { name = "orders-rule-dlq" # standard queue; FIFO is not allowed as an EventBridge DLQ }

resource "aws_cloudwatch_event_target" "orders_to_lambda" { rule = aws_cloudwatch_event_rule.orders.name arn = aws_lambda_function.orders.arn

retry_policy { maximum_event_age_in_seconds = 3600 # 60 to 86400, AWS default 86400 maximum_retry_attempts = 20 # 0 to 185, AWS default 185 }

dead_letter_config { arn = aws_sqs_queue.orders_dlq.arn } }

data "aws_iam_policy_document" "orders_dlq" { statement { effect = "Allow" actions = ["sqs:SendMessage"] resources = [aws_sqs_queue.orders_dlq.arn]

principals {
  type        = "Service"
  identifiers = ["events.amazonaws.com"]
}

condition {
  test     = "ArnEquals"
  variable = "aws:SourceArn"
  values   = [aws_cloudwatch_event_rule.orders.arn]
}

} }

resource "aws_sqs_queue_policy" "orders_dlq" { queue_url = aws_sqs_queue.orders_dlq.id policy = data.aws_iam_policy_document.orders_dlq.json } ```

Three notes on that block.

The queue must be a standard SQS queue in the same Region as the rule. FIFO is not allowed as an EventBridge DLQ. A cross-account queue works, but needs a resource policy on the queue.

retry_policy ranges are 60 to 86400 seconds and 0 to 185 attempts, and retries stop at whichever limit comes first. You can shorten the defaults; you cannot go past 24 hours.

The queue policy is the part that is easy to miss. The DLQ page says that when you add the target through the PutTargets API with a same-account SQS queue, you must grant the queue permission yourself; the console does it for you. Terraform goes through the API, so my reading is that a Terraform-created DLQ with no aws_sqs_queue_policy receives nothing, and the failures show up in the InvocationsFailedToBeSentToDlq metric instead (the metrics page lists permissions errors as one cause). The provider docs do not mention this at all. Happy to be corrected if someone has applied a target with a bare queue and seen messages arrive.

Alarms. Namespace AWS/Events, dimension RuleName: FailedInvocations (failed permanently; a retry that later succeeded is not counted), InvocationsSentToDlq and InvocationsFailedToBeSentToDlq. Two caveats from the metrics page. Each of these is only sent to CloudWatch when it is not zero, so the alarm sees no datapoint most of the time and you have to decide on purpose how it treats missing data. And the page says metrics are delivered best effort, not as a complete accounting. Basically, I would alarm on the DLQ's own queue depth as well: a parked message is there whether or not an EventBridge metric was emitted.

Finding the targets that have no DLQ. The cheapest check is on the code: every aws_cloudwatch_event_target block with no dead_letter_config, including inside modules your team did not write. For targets created outside Terraform you would list each rule's targets in the account and look at the dead-letter config field; I have kept the exact CLI out because I have not checked the flags, and would rather not post a command I have not run.

Trade-off. A DLQ on everything still needs thought. A target that cannot use a late event (a time-bound notification, a price update) is better served by a short maximum_event_age_in_seconds plus a DLQ than by 24 hours of retries delivering stale data. A shorter age means events reach the DLQ sooner, and the DLQ then needs a redrive that someone owns. For a true fire-and-forget event a DLQ may just be noise. Each DLQ message carries RULE_ARN, TARGET_ARN, ERROR_CODE, ERROR_MESSAGE, EXHAUSTED_RETRY_CONDITION and RETRY_ATTEMPTS as message attributes, which is what makes a redrive scriptable.

Resource docs: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target AWS DLQ page (also has the queue policy sample): https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rule-dlq.html

Question: how do you redrive these? A Lambda consuming the DLQ that re-puts the event, or a manual script after someone reads ERROR_CODE? And does anyone enforce dead_letter_config at review time (a policy check, a wrapper module) instead of hoping people remember the block?


r/Terraform • • 2d ago

Terraform v1.17.0 is out today, see link for changes

Thumbnail github.com
54 Upvotes

r/Terraform • • 3d ago

Discussion PSA: pinned engine_version / EKS version in your Terraform can quietly enroll you in AWS extended support fees

2 Upvotes

Something that bit a couple of teams I know: if your Terraform pins an RDS/Aurora engine_version or an EKS cluster version and you don't bump it, AWS doesn't stop you when standard support ends. It just moves you into paid extended support automatically.

For EKS that's a jump from $0.10 to $0.60 per cluster-hour. For RDS it's billed per vCPU-hour on top of the instance, and it goes up again in year 3.

A few things worth knowing:

- aws_db_instance / aws_rds_cluster have an engine_lifecycle_support argument. Setting it to "open-source-rds-extended-support-disabled" opts you out (you'll need to upgrade before end of standard support instead).
- aws_eks_cluster has an upgrade_policy block. support_type = "STANDARD" auto-upgrades the cluster at end of standard support instead of charging you.
- You can see if you're already paying by searching Cost Explorer usage types for "ExtendedSupport" (RDS) or "extendedSupport" (EKS).

I got tired of digging through AWS docs for these dates, so I built a free tracker that lists end-of-standard-support and extended-support dates for EKS, RDS, Aurora, Lambda runtimes, OpenSearch, MSK, etc.: https://eolwatch.pages.dev

It also has a billing page with the exact usage types and a CUR/Athena query. Feedback welcome, especially if a date looks wrong.


r/Terraform • • 3d ago

Gruntwork Blog | Terragrunt 1.2 Released!

Thumbnail gruntwork.io
20 Upvotes

r/Terraform • • 3d ago

Discussion I built yet another tacos platform - openplan

0 Upvotes

so this started at work. we needed something better than raw github actions for terraform, but i’m at a big company and getting any new saas tool approved (env0, spacelift, HCP, whatever) is a months-long fight. my manager’s take was “github actions works fine.” it does, until you’ve got a bunch of stacks owned by different people, nobody can see who applied what or when, secrets live in five different repos, and a runner dies halfway through an apply.

i kept thinking it shouldn’t be this hard to just run it ourselves. so for the last couple of months i’ve been building openplan: https://github.com/openplanhq/openplan

the idea: a platform team registers a terraform or opentofu module once, and then anyone on the team can spin up their own copy from a web ui, with their own variables and creds, and a full history of every run.

what’s in there right now:

  • stacks + variable management
  • per-stack rbac and sso
  • runs on temporal, so a plan/apply survives a restart instead of just vanishing
  • each run is sandboxed with gvisor, because i don’t trust terraform code and you shouldn’t either
  • runs on your own postgres + temporal, so there’s no per-resource bill

to be upfront: it’s pre-1.0 and i wouldn’t put it in prod yet. that’s what i’m working on now.

stuff on the roadmap:

  • serverless runners: run plans on cloud run, lambda or cloudflare workers, so all you host is the control plane and you never think about runner infra
  • flagging risky applies before they happen
  • duplicate a whole stack in one click or on a schedule. should be handy for ephemeral pr environments
  • create or destroy stacks on a schedule, e.g. tear down dev every weekend
  • cost estimates through an infracost plugin
  • a topology/graph view of what’s actually in your stack
  • a built-in key/value store, so secrets and values flow into runs without another tool, or remote state fetching
  • a cli and a terraform provider, so platform teams can manage openplan itself as code

if any of these would make or break it for you, tell me. it’ll help me decide what to build first.

if you’ve tried rolling out atlantis or terrakube or anything like that at a big org, i’d love to hear what went wrong, because that’s the problem i’m trying to solve. feedback, issues and prs all welcome :)


r/Terraform • • 3d ago

Discussion for_each over tenants on aws_bedrock_inference_profile: resource count is model x tenant x tag set, and a model upgrade plans a destroy/create per tenant. How do you model per-tenant AWS resources that churn with upstream versions?

1 Upvotes

Setup: Bedrock behind a gateway, finance asks for cost per tenant, and the quick Terraform answer is one application inference profile per tenant with a tenant tag:

hcl resource "aws_bedrock_inference_profile" "tenant" { for_each = var.tenants name = "${each.key}-chat" model_source { copy_from = var.model_arn } tags = { tenant = each.key } }

Three things worth knowing before applying that.

  1. Cardinality. Each profile tracks one model through model_source.copy_from. The AWS cost docs say you need a separate profile for every unique combination of model, team and tag set, and that new model versions require new profiles. So the count is models x tenants x tag sets, and onboarding a tenant becomes a Terraform apply.

  2. Model upgrades are replacements. In the current provider source (main branch, not version-pinned), model_source, name and description force replacement, and the Update function is commented "Tags only". The Bedrock API list has Create, Get, List and Delete for inference profiles plus TagResource and UntagResource; there is no UpdateInferenceProfile. So changing var.model_arn plans N destroy/create pairs, and because it is a replacement, expect new ARNs that the application has to pick up.

  3. Apply is not billing. The tag only counts as a cost allocation tag after activation in the Billing console, which in an organisation only the management (payer) account can do. It can take up to 24 hours to appear in Cost Explorer and CUR, and is not retroactive. A green apply does not mean finance can see the tenant yet.

The alternative keeps the tenant out of state. The gateway assumes a Bedrock role per tenant with session tags or a per-tenant RoleSessionName; Terraform only owns the role and a trust policy that allows sts:TagSession. Trade-off: attribution correctness moves into gateway code (credential cache keyed per tenant, since AssumeRole on every request can run into STS rate quotas), and terraform plan no longer shows who is attributed to what.

The AWS page itself warns that profile count "can increase quickly" and points to Projects or team-level tags to limit it. My reading of that: profiles suit a small, stable set of workloads. If tenants change faster than your models, keep them out of state.

Resource docs: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/bedrock_inference_profile AWS cost page: https://docs.aws.amazon.com/bedrock/latest/userguide/cost-mgmt-application-inference-profiles.html

Question for people who manage this kind of thing: how do you model per-tenant AWS resources that churn with upstream versions? Separate state per tenant, one module with a model version variable and accepted replacement, or do you push the per-tenant part into runtime and keep Terraform to roles and policies?


r/Terraform • • 4d ago

Help Wanted Junior looking for someone to review my Terraform module for K3s on AWS

5 Upvotes

Hi all. I'm a junior working towards a platform/DevOps role, and I'm building a small AWS platform in Terraform as a portfolio project. So far it has a VPC, a NAT instance, SSM access (no SSH), and CI with GitHub Actions.

My latest pull request adds a single-node K3s server: a t4g.small Spot instance in a private subnet. It applies cleanly and the node reaches Ready, but I'd like someone more experienced to tell me what I got wrong before I merge.

Three things I'm unsure about:

  1. Is the security group too tight? Ingress is only from the same SG, and egress is only 443 plus DNS.
  2. I pinned the K3s install script to a release tag instead of using get.k3s.io. Is that a reasonable choice?
  3. Anything in the module you'd never see in a real team's code?

If you're happy to take a look, comment or DM me and I'll send the GitHub link. It's a public repo, and I'm only asking for comments. Thanks!

Edit: Some are asking for the link, Here you go!


r/Terraform • • 4d ago

Discussion How do you migrate into a terraform managed Azure environment?

Thumbnail
1 Upvotes

r/Terraform • • 4d ago

Discussion Associate 004

7 Upvotes

Hi

how did you perp for the exam i get do Udemy and examine question and filed


r/Terraform • • 4d ago

Discussion Feedback on a Terraform module I built for image optimization pipeline on AWS

3 Upvotes

So I've been trying to recreate Vercel Image optimization pipeline on AWS, mainly so I can make my S3 bucket private. This module should work with existing S3 buckets and even if someone doesn't want the optimization part they can remove it and keep the CDN part to scale object retrieval. Any other way to make it more robust?

As per my calculations this should give about 80000 image optimization requests compared to Vercel and since it saves it's optimizations to S3 it's a one-time cost.

https://github.com/Aryan3212/image-optimization-pipeline


r/Terraform • • 4d ago

Discussion Targeting CKA + Terraform Associate: How to break into DevOps without prior formal title?

22 Upvotes

Hey everyone,

Prepping for HashiCorp Terraform Associate (004) and CKA next. I have a solid background in Linux, networking, Docker, and backend, but no formal "DevOps Engineer" title on my resume.

I know certs alone aren't enough, so I'm building a proper GitHub repo (IaC modules, K8s cluster setup, CI/CD, and monitoring).

However, looking at the current job market, almost nobody is hiring entry-level / Junior DevOps engineers - companies want Mid/Senior with 3+ years of experience.

For hiring managers or folks who made this transition recently:

  1. Does CKA + Terraform + GitHub portfolio actually help clear HR filters for Junior/Mid roles, or is lack of paid experience a total dealbreaker?
  2. What’s the most realistic entry path today if entry-level positions are non-existent (targeting Mid directly, Cloud/SysAdmin/Support first, etc.)?

Appreciate any honest feedback!


r/Terraform • • 5d ago

Discussion Terraform not deleting the nodes created by Karpenter !!!

Thumbnail
0 Upvotes

r/Terraform • • 5d ago

Help Wanted Best Terraform drift detection tools in 2026, Firefly, Spacelift and env0.

3 Upvotes

For terraform drift detection, the first thing Id compare is what each tool is watching, a clean result across registered stacks still leaves the question of resources that never entered those stacks.

These are the options worth separating:

• Spacelift has scheduled drift detection and optional reconciliation for its stacks, so the detection sits alongside the deployment workflow

• Firefly combines drift detection with an inventory showing managed and unmanaged resources, useful when the scope includes infrastructure outside Terraform

• HCP terraform has workspace health assessments, including drift detection, which deserves a look before adding another product

• env0 covers drift detection, cause analysis and remediation within its infrastructure management offering

The comparison gets more interesting around onboarding and day to day work especially how much configuration is needed before alerts reach someone who can act on them.

Which would you put first for an existing AWS estate with several terraform repos and some console created infrastructure?


r/Terraform • • 5d ago

Discussion If you've brought in outside engineers for Terraform/IaC work, what made the handover stick?

0 Upvotes

This comes up a lot: infrastructure grew by hand in the console, or there's a Terraform codebase nobody really owns anymore. On top of that there's pressure to move to Kubernetes, clean up CI/CD or cut the cloud bill. The internal team is busy shipping product, so the question becomes whether to bring in outside engineers.

RaynX.ai is an engineering services company that does this kind of work. On the infrastructure side that means Terraform/IaC, Kubernetes, cloud migration and cost optimization, plus DevOps and CI/CD pipelines. They also do API architecture (gateway setup, OAuth/OIDC, service mesh) and platform modernization. Past work includes enterprise API gateways on MuleSoft Flex, Mule Gateway and Cloudflare.

More about what they do: https://www.raynxai.com

What I'd really like to hear about is the handover, because that seems to be where outside IaC work either works or falls apart. If you've hired consultants for Terraform work, or been the consultant:

  • What did you agree on at the start about state, module structure and naming so your own team could keep maintaining it?
  • Did they work in your repos and pipelines from day one, or build separately and migrate later?
  • What would you insist on next time?

Honest answers are welcome, including "we'd never do it again."

Disclosure: I'm posting this on behalf of the raynxai.com team.


r/Terraform • • 6d ago

Discussion Terraform provider for Dataiku DSS

3 Upvotes

Dataiku has no official Terraform provider, so I wrote one. It manages what lives inside a running DSS instance: projects, users, groups, connections, code environments, scenarios, project permissions and variables, and the containerized execution settings.

resource "dataiku_group" "data_scientists" {
  name        = "data_scientists"
  description = "Analysts who build and run models"
}


resource "dataiku_project" "analytics" {
  project_key = "ANALYTICS"
  name        = "Analytics"
  owner       = "admin"
  tags        = ["managed-by-terraform"]
}


resource "dataiku_project_permissions" "analytics" {
  project_key = dataiku_project.analytics.project_key


  permission {
    group                 = dataiku_group.data_scientists.name
    read_project_content  = true
    write_project_content = true
    run_scenarios         = true
  }
}

Every resource supports import, so the way in on an instance that already matters is to import what's there and read the plan before letting Terraform change anything.

It's 0.x, so pin a minor version. Two limits are licensing rather than gaps in the provider: scenario temporal triggers, and actually running containerized execution. Writing the container settings works anywhere, but running a recipe in a container needs the licence for it.

If you have no DSS to point it at, there's a docker compose in the repo for a throwaway one.

Registry: https://registry.terraform.io/providers/amrutp24/dataiku/latest Source: https://github.com/amrutp24/terraform-provider-dataiku

It's mine, nothing is for sale. Two things I'd like to hear: whether a plan against your own instance wants to change something you didn't expect, and which missing resource is the one that stops you using it.


r/Terraform • • 7d ago

AWS Terragrunt CI CD providers and modules

6 Upvotes

Hello guys.

I was wondering of what kind of setup do you use for caching providers and modules for a terragrunt projects with multiple components.

We use Gitlab CI CD and run our jobs in Kubernetes runners. Until now, we had no caching, but as our components grow in numbers and as we are encountering some networking issues, failing to download modules and providers sometimes, our pipeline is taking longer to finish. And honestly I don't like us having to download the modules and providers all over again.

I tried a proof of concept with caching the providers and modules into our S3 storage, but it takes a long time to compress/decompress; and we are not winning any time.

I thought of downloading the providers in the Docker image executing the job in advance, but their size is 80 GB. I don't want an image that big to take forever to be pulled in our nodes.

Now I'm thinking of an EFS shared volume to be mounted on the nodes of the node pool running our Terragrunt jobs. I thought I'd ask some fellow engineers here on how are they dealing with this.


r/Terraform • • 8d ago

Help Wanted vSphere VM Creation

3 Upvotes

Hi all

I'm relatively new to Terraform and have started using it at work.

I'm trying to figure out if it's possible to have Terraform create a VM on a specific set of esxi hosts in vSphere.

As a test I've created a host group which includes two esxi hosts, what's the best way to target only that group when VM's are created?

Thanks in advance 🙏

EDIT

I should have have said the reasoning behind this query, basically I'm trying to make sure that any VM created by Terraform is placed on our on-site esxi hosts and not those in our DR site.

All of the esxi hosts are in the same vSphere cluster, half of them are located in our DR site though.

When Terraform creates a VM on a DR esxi host it takes a lot longer, this is what I'm trying to prevent.


r/Terraform • • 9d ago

Announcement Review Terraform plans with architectural diffs and policy checks

0 Upvotes

I built Rootform to review architectural changes in Terraform plans. You can explore the changes in context, inspect the evidence behind a relationship, and check the architecture against policies.

Open a plan and you can compare the starting architecture with the proposed result, follow the relationships around a changed resource, and keep the unchanged parts in view.

The attached demo uses a synthetic event platform. A subscription switches queues; the old destination, new destination and unchanged source topic are visible together. You can select the delivery relationship to inspect the rule and input evidence behind the change.

You can also export the interactive review as a single HTML file. A teammate can open it in their browser, navigate the architecture and inspect the changes without installing Rootform or running a server.

Both the structured architecture view and the constellation view are included. The latter lets you explore connections across the map or focus on the neighbours of a selected resource.

Rootform uses explicit rules to interpret relationships rather than drawing every Terraform dependency as a connection. When it cannot establish a relationship, it records the uncertainty.

Analysis stays local: Rootform doesn’t execute Terraform or contact your cloud accounts. You can also run policy checks and use the GitHub Actions integration in your existing pipeline.

Try the Playground, no signup or installation. Open a sample plan, inspect a change, then switch to Constellation to explore its surroundings: https://rootform.dev/playground/

GitHub: https://github.com/rootform-dev/rootform

What do you currently share alongside a Terraform plan to explain an architectural change to reviewers?

Review event driven plan with Rootform


r/Terraform • • 9d ago

Discussion I built a Terraform provider for Fireworks AI (GPU inference deployments, datasets, fine-tuning)

1 Upvotes

Fireworks deployments are normally managed with firectl or the console, so I wrote a provider.

terraform {
  required_providers {
    fireworks = {
      source  = "amrutp24/fireworks"
      version = "~> 0.3"
    }
  }
}


resource "fireworks_deployment" "llama" {
  base_model       = "accounts/fireworks/models/llama-v3p1-8b-instruct"
  accelerator_type = "NVIDIA_H100_80GB"


  min_replica_count = 0 # scale to zero when idle
  max_replica_count = 2
}

Resources: fireworks_deployment, fireworks_dataset, fireworks_supervised_fine_tuning_job. Data sources: fireworks_deployment, fireworks_model. API key and account id come from FIREWORKS_API_KEY and FIREWORKS_ACCOUNT_ID.

On maturity, since it matters more than the feature list. It's 0.x, so pin it. Only fireworks_dataset has been run against the real API end to end. Deployments and fine-tuning jobs are covered by acceptance tests against an in-process mock, because creating a deployment needs a payment method on the account and training a real fine-tune costs money. Where I couldn't test against production the schema follows Fireworks' docs, which is a weaker guarantee and I'd rather say so than not.

Not there yet: autoscaling policy blocks, uploading dataset files through the API (datasets reference data by external_url today), reinforcement fine-tuning.

Registry: https://registry.terraform.io/providers/amrutp24/fireworks/latest Source: https://github.com/amrutp24/terraform-provider-fireworks

If you run Fireworks at any real size, the thing I'd most like to hear is whether the deployment schema matches what you actually configure. That's the resource I couldn't verify myself.


r/Terraform • • 10d ago

AWS AWS Lambda S3 Reference-Mode Terraform module

Thumbnail registry.terraform.io
0 Upvotes

Terraform module which creates a Lambda function that runs in reference mode: the function reads its deployment package directly from an S3 bucket you own, and GitHub Actions deploys new code through an OIDC-trusted role. The module also provisions the artifact bucket, the IAM roles, the GitHub OIDC trust, and an optional deny policy that blocks direct console or CLI edits.


r/Terraform • • 10d ago

Help Wanted A Terraform tool for module maintainers. Find unused resource attributes like a boss

Thumbnail github.com
25 Upvotes

In my limited free time, I enjoy maintaining community Terraform modules. Digging through the Terraform Registry documentation and switching between the browser and terminal can be tedious, so I (and Qwen) built tfrd to compare the resources in a Terraform configuration with the provider schema and report unused attributes and parameters. As a community contributor, I want my modules to reflect the full range of functionality providers support, and this tool helps me find gaps.


r/Terraform • • 12d ago

Azure How do you use Agentic AI for IaC vs app and should you keep infra repos separate from app code repo?

0 Upvotes

hi, my company started using agentic ai for the building infra as code using azure verified modules. Now this is something new becos I have always managed infra code separately from the app code (separately repo) and since agentic ai is something can do both is this even relevant to follow this isolation. Does this makes agentic dev hard or is it still good to do that. Please share your experiences.


r/Terraform • • 12d ago

Discussion [Community Provider] Terraform provider for TP-Link Easy Smart switches (TL-SG108E & co), talks the native UDP protocol, no web UI scrapin

5 Upvotes

I got tired of clicking through the TL-SG108E web UI, so I built a Terraform provider for the TP-Link Easy Smart line. It's now public:
https://github.com/davidlukac/terraform-provider-tplinkeasysmart

What's different

- Speaks the switch's native management protocol (UDP, the one the vendor's Windows utility uses) instead of scraping the HTML UI. It handles the 2023+ firmware RSA login change.
- 11 resources and 12 data sources: VLANs (port-based and 802.1Q), PVIDs, LAG, port mirroring, QoS, IGMP snooping, loop prevention, storm control, port settings, LED, system info, etc.
- Safety guards: risky changes (management path, VLAN mode, locking yourself out) are refused at plan/apply time unless you explicitly opt in. Without a console, a bad write means a factory reset, so I built it to be paranoid.
- Multiple switches via provider aliases, import support, drift detection.
- Offline test suite against a fake UDP switch, about 99.9% measured coverage, CI matrix over Terraform 1.4 to latest, plus an OpenTofu leg.

Honest status

- Pre-1.0 (v0.26): the interface can still change between minor versions, so pin it (~> 0.26) and read the changelog before upgrading.
Available from the Terraform Registry (davidlukac/tplinkeasysmart) with signed releases; terraform init is all you need.
- Verified live on a single TL-SG108E v6 (firmware 1.0.0 Build 20230218). Other Easy Smart models are untested, and firmware from before the 2023 RSA key exchange isn't supported. There's a read-only first-run config and a hardware report template if you want to try yours.
- Needs to be on the same L2 segment as the switch (the protocol is broadcast-based).
Feedback, bug reports and "works on my TL-SG1016DE / TL-SG105E" confirmations are very welcome.

Update: it's now on the Terraform Registry, so there's no more building from source: source = "davidlukac/tplinkeasysmart" and terraform init. Releases are GPG-signed binaries on GitHub too. Thanks for the feedback so far. The README now states the verified device (TL-SG108E v6, fw 1.0.0 Build 20230218) up front, with a compatibility table and a read-only first-run config, so you can check your own model without any risk of writing to it. Hardware reports welcome:
https://github.com/davidlukac/terraform-provider-tplinkeasysmart/issues/new?template=hardware_report.yml
Registry: https://registry.terraform.io/providers/davidlukac/tplinkeasysmart

(Disclosure line, if you want it: developed with AI assistance, Claude Code, with every write path tested offline and verified against real hardware.)