<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Manu Chandrasekhar on Medium]]></title>
        <description><![CDATA[Stories by Manu Chandrasekhar on Medium]]></description>
        <link>https://medium.com/@manuchandrasekhar?source=rss-53b65d46bb8e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JjRypsxKtciF-MHMVMUEAQ.png</url>
            <title>Stories by Manu Chandrasekhar on Medium</title>
            <link>https://medium.com/@manuchandrasekhar?source=rss-53b65d46bb8e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 05:24:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manuchandrasekhar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Terraform 1.15 Alpha: Dynamic Module Sources]]></title>
            <link>https://manuchandrasekhar.medium.com/terraform-1-15-alpha-dynamic-module-sources-ca8da45bb82e?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca8da45bb82e</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[alpha]]></category>
            <category><![CDATA[provider]]></category>
            <category><![CDATA[dynamics]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 14:26:58 GMT</pubDate>
            <atom:updated>2026-03-10T23:11:04.574Z</atom:updated>
            <content:encoded><![CDATA[<p>Terraform version <a href="https://github.com/hashicorp/terraform/releases/tag/v1.15.0-alpha20260304">1.15.0-alpha20260304</a> is released and with it comes another feature which I have been keeping an eye out for. I will be honest that I skipped past the original PR for const being added to variable blocks a few times before realizing what feature it would come under ;).</p><p>Modules have become the standard to create the golden pathways to provision infrastructure in most organizations in the way they desire ; according to their naming conventions, security standards and so on. Some stand up their own modules. Some use the public ones directly, while a few might fork the public community modules into their own git repositories. While all of this helps bring standardization, managing a versioned entity comes with the questions around upgrades and a good way to handle those environments/lifecycles.</p><ul><li>Are the updates in the upstream module safe for me to fork and use ?</li><li>Are the new changes already available for any wrapper modules I may be using ?</li><li>Can I test this in a single environment without having to update my prod or staging as I have some existing releases planned which I don’t want to disrupt ?</li></ul><p>Some of these have lead teams to create copies of module invocation across different folders in a single repo for provisioning the same set of infrastructure with some small changes due to module upgrades in a lifecycle compared to the other. I am not saying all of this is addressed in its entirety with the post here, but it does give you a good way to redfine your processes around module sources.With <a href="https://github.com/hashicorp/terraform/pull/38217">PR #38217</a> merged, you can now use variables in module source and version attributes in your current configurations. Lets dive into it.</p><blockquote><strong><em>Note</em></strong><em>: This post covers features from Terraform 1.15.0-alpha20260304. As this is an alpha release, syntax and behavior may change before the final release. Do not use this in production yet.</em></blockquote><h3>Pre-1.15-alpha</h3><p>I have terraform aliased to tf if you see that being used across the code blocks. Confirm the version of Terraform binary installed.</p><pre>tf --version<br>Terraform v1.14.6<br>on darwin_arm64</pre><p>A typical module usage looks something like below. Picking the easiest community module which has not many inputs for this post and some scenarios here.</p><pre># main.tf <br>module &quot;vpc&quot; {<br>  source  = &quot;terraform-aws-modules/vpc/aws&quot;<br>  version = &quot;6.6.0&quot;<br>}</pre><p>To address some of the questions I posted above, the natural inclination would be to look at some parameterization in the module source. Can we make these source and version be variables ?</p><pre>module &quot;vpc&quot; {<br>  source  = var.module_source<br>  version = var.module_version<br>}<br><br># variables.tf<br>variable &quot;module_source&quot; {<br>  type    = string<br>  default = &quot;terraform-aws-modules/vpc/aws&quot;<br>}<br><br>variable &quot;module_version&quot; {<br>  type    = string<br>  default = &quot;6.6.0&quot;<br>}</pre><pre>tf init<br>Initializing the backend...<br>Initializing modules...<br>╷<br>│ Error: Variables not allowed<br>│<br>│   on main.tf line 2, in module &quot;vpc&quot;:<br>│    2:   source  = var.module_source<br>│<br>│ Variables may not be used here.<br>╵<br>│ Error: Unsuitable value type<br>│<br>│   on main.tf line 2, in module &quot;vpc&quot;:<br>│    2:   source  = var.module_source<br>│<br>│ Unsuitable value: value must be known<br>╵<br>│ Error: Variables not allowed<br>│<br>│   on main.tf line 3, in module &quot;vpc&quot;:<br>│    3:   version = var.module_version<br>│<br>│ Variables may not be used here.</pre><h3>Post alpha</h3><p>From the PR documentation, this is what I am gathering:</p><ul><li>You can use variables inside the module blocks for source and version (where it is supported). Version doesn&#39;t come into play in case of inline modules or git sourced modules.</li><li>You express the variables which need to be used with an identifier called const=true. This ties back to the requirement of the value needing to be known while you perform an initialization which downloads the necessary modules for your configuration.</li></ul><p>Let’s change some of the fields in our previous example to this update. First off, update our terraform version to use the latest alpha.</p><pre>tf --version<br>Terraform v1.15.0-alpha20260304<br>on darwin_arm64</pre><h3>Scenario 1</h3><p>Lets upgrade the Terraform version and leave the variables how they were in the previous example.</p><pre>module &quot;vpc&quot; {<br>  source  = var.module_source<br>  version = var.module_version<br>}<br><br># variables.tf<br>variable &quot;module_source&quot; {<br>  type    = string<br>  default = &quot;terraform-aws-modules/vpc/aws&quot;<br>}<br><br>variable &quot;module_version&quot; {<br>  type    = string<br>  default = &quot;6.6.0&quot;<br>}</pre><p>Run terraform init.</p><pre>tf init<br>Initializing modules...<br>╷<br>│ Error: Invalid module version<br>│<br>│   on main.tf line 3, in module &quot;vpc&quot;:<br>│    3:   version = var.module_version<br>│<br>│ The module version contains a reference that is unknown during init.<br>╵</pre><p>The error message has changed from not being able to use variables to a reference unknown during init. There comes the const attribute. Lets try with the updated configuration. The language server might still give the Unexpected attribute: An attribute named &quot;const&quot; is not expected here (Terraform) message. Lets ignore that for the time being.</p><pre># main.tf<br>module &quot;vpc&quot; {<br>  source  = var.module_source<br>  version = var.module_version<br>}<br><br># variables.tf<br>variable &quot;module_source&quot; {<br>  type    = string<br>  default = &quot;terraform-aws-modules/vpc/aws&quot;<br>  const   = true<br>}<br><br>variable &quot;module_version&quot; {<br>  type    = string<br>  default = &quot;6.6.0&quot;<br>  const   = true<br>}</pre><p>Run terraform init.</p><pre>tf init<br>Initializing modules...<br>Downloading registry.terraform.io/terraform-aws-modules/vpc/aws 6.6.0 for vpc...<br>- vpc in .terraform/modules/vpc<br>Initializing provider plugins found in the configuration...<br>- Finding hashicorp/aws versions matching &quot;&gt;= 6.28.0&quot;...<br>- Installing hashicorp/aws v6.34.0...<br>- Installed hashicorp/aws v6.34.0 (signed by HashiCorp)<br><br>Initializing the backend...<br><br>Terraform has created a lock file .terraform.lock.hcl to record the provider<br>selections it made above. Include this file in your version control repository<br>so that Terraform can guarantee to make the same selections by default when<br>you run &quot;terraform init&quot; in the future.<br><br>Terraform has been successfully initialized!</pre><p>Woah ! It worked. It used the source and version references passed into the module block from the variable. Now, I still need to get my head around const used with variables. They just don&#39;t go together in my head. If you do a terraform init with the TF_LOG set to trace or debug, you could see the path to resolution is a little different compared to the previous version. You can ignore this block if you are only concerned about the usage side of it.</p><pre>### Terraform 1.14.6 (Static)<br>[TRACE] ModuleInstaller: installing child modules<br>[TRACE] ModuleInstaller: vpc is not yet installed<br>[TRACE] ModuleInstaller: vpc is a registry module<br>(downloads module)<br><br>### Terraform 1.15.0-alpha (Dynamic)<br>[TRACE] building graph for terraform dependencies<br>[TRACE] ModuleTransformer: Added module.vpc as *terraform.nodeInstallModule<br>[DEBUG] ReferenceTransformer: &quot;module.vpc&quot; references: [var.module_source var.module_version]<br>[DEBUG] Starting graph walk: walkInit<br>[TRACE] NodeRootVariable: evaluating var.module_source<br>[TRACE] NodeRootVariable: evaluating var.module_version<br>[TRACE] vertex &quot;module.vpc&quot;: starting visit<br>[TRACE] vertex &quot;module.vpc&quot;: expanding dynamic subgraph<br>[TRACE] Completed graph transform:<br>module.vpc - *terraform.nodeInstallModule<br>  var.module_source - *terraform.NodeRootVariable<br>  var.module_version - *terraform.NodeRootVariable<br>root - terraform.graphNodeRoot<br>  module.vpc - *terraform.nodeInstallModule<br>var.module_source - *terraform.NodeRootVariable<br>var.module_version - *terraform.NodeRootVariable<br><br> [TRACE] PrepareFinalInputVariableValue: preparing var.module_source                                                                                  <br> [TRACE] PrepareFinalInputVariableValue: var.module_source has a default value<br> [TRACE] PrepareFinalInputVariableValue: var.module_source has no defined value                                                                       <br> [TRACE] vertex &quot;var.module_source&quot;: visit complete<br> [TRACE] NodeRootVariable: evaluating var.module_version                                                                                            <br> [TRACE] PrepareFinalInputVariableValue: preparing var.module_version<br> [TRACE] PrepareFinalInputVariableValue: var.module_version has a default value                                                                       <br> [TRACE] PrepareFinalInputVariableValue: var.module_version has no defined value</pre><p>Let’s look at some other scenarios in the mean time.</p><h3>Scenario 2: Environment-Based Versioning</h3><p>What if I could set some module versions based on some other conditional , like the environment I am deploying to ? The thing to keep in mind is that the variables referenced to provide that information for the module block need to be able to gather that value for the init step.</p><pre># variables.tf<br>variable &quot;environment&quot; {<br>  type        = string<br>  # const       = true  &lt;- commented<br>  description = &quot;Deployment environment&quot;<br>}<br><br># data.tf<br>locals {<br>  module_versions = {<br>    dev     = &quot;5.2.0&quot;<br>    staging = &quot;5.1.0&quot;<br>    prod    = &quot;5.0.0&quot;<br>  }<br>  module_version = local.module_versions[var.environment]<br>}<br><br># main.tf<br>module &quot;versioned&quot; {<br>  source  = &quot;terraform-aws-modules/vpc/aws&quot;<br>  version = local.module_version<br>}</pre><p>With const attibute commented out, we see the error below. In my first run of this, I forgot about the const attribute while I was copying the examples over. But it ascertains the need for the const attribute on any variables used for module sources.</p><pre>Initializing modules...<br>╷<br>│ Error: Invalid module version<br>│<br>│   on main.tf line 3, in module &quot;versioned&quot;:<br>│    3:   version = local.module_version<br>│<br>│ The module version contains a reference that is unknown during init.</pre><p>With no default values, as expected we get terraform complaining about it.</p><pre>Initializing modules...<br>╷<br>│ Error: No value for required variable<br>│<br>│   on main.tf line 2:<br>│    2: variable &quot;environment&quot; {<br>│<br>│ The root module input variable &quot;environment&quot; is not set, and has no default value. Use a -var or -var-file command line argument to provide a value for this variable.</pre><p>Let’s use some runtime args to help us here.</p><h3>environment=dev:</h3><pre>tf init --var=environment=dev<br>Initializing modules...<br>Downloading registry.terraform.io/terraform-aws-modules/vpc/aws 5.2.0 for versioned...<br>- versioned in .terraform/modules/versioned<br>Initializing provider plugins found in the configuration...<br>- Finding hashicorp/aws versions matching &quot;&gt;= 5.0.0&quot;...<br>- Installing hashicorp/aws v6.34.0...<br>- Installed hashicorp/aws v6.34.0 (signed by HashiCorp)<br><br>Initializing the backend...<br>Terraform has been successfully initialized!</pre><h3>environment=prod:</h3><pre>tf init --var=environment=prod<br>Initializing modules...<br>Downloading registry.terraform.io/terraform-aws-modules/vpc/aws 5.0.0 for versioned...<br>- versioned in .terraform/modules/versioned<br>Initializing provider plugins found in the configuration...<br>- Reusing previous version of hashicorp/aws from the dependency lock file<br>- Using previously-installed hashicorp/aws v6.34.0<br><br>Initializing the backend...<br>Terraform has been successfully initialized!</pre><blockquote><em>VPC module version swapped between 5.2.0 and 5.0.0 based on the environment we are targetting.</em></blockquote><p>Would I use this ? Maybe, when I am testing a new version in the lower environments ;especially patch or minor versions which doesn’t have a breaking change on the inputs. What else does this unlock ? I am going a little crazy with this , but why not !!</p><h3>Scenario 3 : version reference in git sourced modules ?</h3><p>One of the primary ways organizations share Terraform modules is via some git repository. Whats the difference you ask ? The git sourced modules do not have a version attribute, but rather expects it as part of the source itself following the ref= . With the option to construct the source dynamically, this changes things.</p><p>Lets use the tfvars to pass in some input to determine what version of the ref you want.</p><pre># main.tf<br>module &quot;glue&quot; {<br>  source = &quot;git::https://github.com/quixoticmonk/terraform-aws-glue.git?ref=${local.selected_version}&quot;<br>}<br><br>#variables.tf<br>variable &quot;version&quot; {<br>  type        = string<br>  const       = true<br>  description = &quot;Version to use: stable, latest, or main&quot;<br>  validation {<br>    condition     = contains([&quot;stable&quot;, &quot;latest&quot;, &quot;main&quot;], var.version)<br>    error_message = &quot;Version must be stable, latest, or main.&quot;<br>  }<br>}<br><br># data.tf<br>locals {<br>  git_versions = {<br>    stable = &quot;v0.0.2&quot;<br>    latest = &quot;v0.0.3&quot;<br>    main   = &quot;main&quot;<br>  }<br>  selected_version = local.git_versions[var.version]<br>}</pre><p>Run terraform init</p><pre>tfi --var-file=dev.tfvars<br>Initializing modules...<br>Downloading git::https://github.com/quixoticmonk/terraform-aws-glue.git?ref=main for glue...<br>- glue in .terraform/modules/glue<br>╷<br>│ Error: Invalid variable name<br>│<br>│   on main.tf line 7, in variable &quot;version&quot;:<br>│    7: variable &quot;version&quot; {<br>│<br>│ The variable name &quot;version&quot; is reserved due to its special meaning inside module blocks.</pre><p>Hmmm, thats not what I expected. Seems like version is a reserved keyword. What about source ? Lets take a step back and define just the variables and see how init behaves.</p><pre># variables.tf<br>variable &quot;source&quot; {<br>  type        = string<br>  description = &quot;Source path for the module&quot;<br>}<br><br>variable &quot;version&quot; {<br>  type = string<br>  description = &quot;version to be used&quot;<br>}</pre><p>Run terraform init :</p><pre>tfi<br>╷<br>│ Error: Terraform encountered problems during initialisation, including problems<br>│ with the configuration, described below.<br>│<br>│ The Terraform configuration must be valid before initialization so that<br>│ Terraform can determine which modules and providers need to be installed.<br>│<br>│ Error: Invalid variable name<br>│<br>│   on variables.tf line 2, in variable &quot;source&quot;:<br>│    2: variable &quot;source&quot; {<br>│<br>│ The variable name &quot;source&quot; is reserved due to its special meaning inside module blocks.<br>╵<br>│ Error: Invalid variable name<br>│<br>│   on variables.tf line 7, in variable &quot;version&quot;:<br>│    7: variable &quot;version&quot; {<br>│<br>│ The variable name &quot;version&quot; is reserved due to its special meaning inside module blocks.</pre><p>Let’s rename those variables and test what we wanted to start with :</p><pre># main.tf<br>module &quot;glue&quot; {<br>  source = &quot;git::https://github.com/quixoticmonk/terraform-aws-glue.git?ref=${local.selected_version}&quot;<br>}<br><br>#variables.tf<br>variable &quot;module_version&quot; {<br>  type        = string<br>  const       = true<br>  description = &quot;Version to use: stable, latest, or main&quot;<br><br>  validation {<br>    condition     = contains([&quot;stable&quot;, &quot;latest&quot;, &quot;main&quot;], var.module_version)<br>    error_message = &quot;Version must be stable, latest, or main.&quot;<br>  }<br>}<br><br># data.tf<br>locals {<br>  git_versions = {<br>    stable = &quot;v0.0.2&quot;<br>    latest = &quot;v0.0.3&quot;<br>    main   = &quot;main&quot;<br>  }<br>  selected_version = local.git_versions[var.module_version]<br>}<br><br># dev.tfvars <br>module_version = &quot;main&quot;<br><br># prod.tfvars <br>module_version = &quot;stable&quot;</pre><p>Init with dev tfvars :</p><pre>tfi --var-file=dev.tfvars<br>Initializing modules...<br>Downloading git::https://github.com/quixoticmonk/terraform-aws-glue.git?ref=main for glue...  # main branch<br>- glue in .terraform/modules/glue<br>Initializing provider plugins found in the configuration...<br>- Finding hashicorp/aws versions matching &quot;&gt;= 5.0.0&quot;...<br>...<br><br>Initializing the backend...</pre><p>Init with prod tfvars :</p><pre>tfi --var-file=prod.tfvars<br>Initializing modules...<br>Downloading git::https://github.com/quixoticmonk/terraform-aws-glue.git?ref=v0.0.2 for glue... # v0.0.2 release tag<br>- glue in .terraform/modules/glue<br>Initializing provider plugins found in the configuration...<br>....<br><br>Initializing the backend...</pre><blockquote><em>dev used the </em><em>main branch reference while prod used </em><em>v0.0.2 based on the map.</em></blockquote><p>So the painpoint around git sourced modules can be resolved with the locally constructed source path. But it did bring up two constraints on common variable names which organizations might have.</p><blockquote><em>source and </em><em>version cannot be used as variables going forward as they have special meaning with the module blocks. That seems like a fair exchange for the benefits with the dynamic source we are getting.</em></blockquote><p>Since we can change the source, why not define some variables to dictate if you should be able to use to the publicly available registry compared to the private ones. The example below is a little contrived, but you get the idea. I have seen customers who want to test their forks of public modules from their private repos in a lower environment before merging it in. Sometimes the blast radius of changes are not so visible in the changelogs or a small example which most modules keep. Running a plan against something which is currently using that module exhaustingly would surface any possible issues.</p><pre># variables.tf<br>variable &quot;use_private_registry&quot; {<br>  type        = bool<br>  const       = true<br>  description = &quot;Whether to use private registry&quot;<br>}<br><br>locals {<br>  registry_source = var.use_private_registry ? <br>    &quot;app.terraform.io/myorg/vpc/aws&quot; : <br>    &quot;terraform-aws-modules/vpc/aws&quot;<br>    <br>  module_version = var.use_private_registry ? &quot;5.0.0&quot; : &quot;5.1.0&quot;<br>}<br><br># main.tf<br>module &quot;vpc&quot; {<br>  source  = local.registry_source<br>  version = local.module_version<br>}</pre><h3>Scenario 4: What about swapping a git sourced module with a registry module ?</h3><p>Configuration:</p><pre>variable &quot;use_local&quot; {<br>  type  = bool<br>  const = true<br>}<br><br>locals {<br>  source = var.use_local ? &quot;./modules/local&quot; : &quot;terraform-aws-modules/vpc/aws&quot;<br>}<br><br>module &quot;example&quot; {<br>  source  = local.source<br>  version = var.use_local ? null : &quot;5.0.0&quot;<br>}</pre><p>Run terraform init :</p><pre>tfi --var=use_local=true<br>Initializing modules...<br>╷<br>│ Error: Invalid registry module source address<br>│<br>│   on main.tf line 3, in module &quot;example&quot;:<br>│    3:   source  = local.source<br>│<br>│ Failed to parse module registry address: can&#39;t use local directory &quot;./modules/local&quot; as a module registry address.<br>│<br>│ Terraform assumed that you intended a module registry source address because you also set the argument &quot;version&quot;, which applies only to registry modules.</pre><blockquote><em>This seems to be a NO-GO as Terraform assumes you want to use the registry source as an address when you set the argument </em><em>version even though it will be null due to the value of </em><em>use_local variable.</em></blockquote><p>Even though version = var.use_local ? null : &quot;5.0.0&quot; should conditionally set the version, Terraform&#39;s module type detection seems to happen at the structure level, not at the evaluation level. The presence of the version attribute in the HCL block triggers registry module handling from what I can understand. In <a href="https://github.com/hashicorp/terraform/blob/main/internal/configs/module_call.go">internal/configs/module_call.go</a>, the module block structure stores both source and version as HCL expressions:</p><pre>type ModuleCall struct {<br>    Name string<br>    SourceExpr hcl.Expression  // Expression, not evaluated value<br>    VersionExpr hcl.Expression // Expression, not evaluated value<br>    // ...<br>}</pre><p>And I think Terraform only checks if the attribute is present in the HCL block and expects it to be a registry module.</p><h3>Scenario 5 — pass in versions or sources for nested modules</h3><p>Nested modules are a matter of contention to start with. How many layers of abstraction would you create with modules? I get lost after a second layer. I am not entirely sure if this is a good idea, but in the spirit of experimenting here goes…</p><p>Consider a three-layer structure:</p><pre>root (main.tf)<br>  └─&gt; parent module (modules/parent)<br>       └─&gt; child module (modules/child)<br>            └─&gt; public registry module (terraform-aws-modules/vpc/aws)</pre><p><strong>Root module</strong> (main.tf):</p><pre>module &quot;parent&quot; {<br>  source = &quot;./modules/parent&quot;<br><br>  vpc_name           = &quot;example-vpc&quot;<br>  vpc_cidr           = &quot;10.0.0.0/16&quot;<br>  azs                = [&quot;us-west-2a&quot;, &quot;us-west-2b&quot;, &quot;us-west-2c&quot;]<br>  vpc_module_version = &quot;~&gt; 5.0&quot;<br>}</pre><p><strong>Parent module</strong> ( modules/parent/main.tf):</p><pre>variable &quot;vpc_module_version&quot; {<br>  type        = string<br>  description = &quot;Version constraint for VPC module&quot;<br>  default     = &quot;~&gt; 5.0&quot;<br>}<br><br>module &quot;child&quot; {<br>  source = &quot;../child&quot;<br><br>  vpc_name           = var.vpc_name<br>  vpc_cidr           = var.vpc_cidr<br>  azs                = var.azs<br>  vpc_module_version = var.vpc_module_version<br>}</pre><p><strong>Child module</strong> ( modules/child/main.tf):</p><pre>variable &quot;vpc_module_version&quot; {<br>  type        = string<br>  description = &quot;Version constraint for VPC module&quot;<br>  const       = true  # Required for dynamic version<br>}<br><br>module &quot;vpc&quot; {<br>  source  = &quot;terraform-aws-modules/vpc/aws&quot;<br>  version = var.vpc_module_version<br><br>  name = var.vpc_name<br>  cidr = var.vpc_cidr<br>  azs  = var.azs<br>  # ... other VPC configuration<br>}</pre><p>Running terraform init:</p><pre>tfi<br>Initializing modules...<br>- parent in modules/parent<br>- parent.child in modules/child<br>Downloading registry.terraform.io/terraform-aws-modules/vpc/aws 5.21.0 for parent.child.vpc... &lt;- downloaded 5.21.0<br>- parent.child.vpc in .terraform/modules/parent.child.vpc<br>Initializing provider plugins found in the configuration...<br>- Finding hashicorp/aws versions matching &quot;&gt;= 5.79.0&quot;...<br>- Installing hashicorp/aws v6.34.0...<br>- Installed hashicorp/aws v6.34.0 (signed by HashiCorp)<br><br>Initializing the backend...<br>..<br>Terraform has been successfully initialized!</pre><p>Switching the input to use &quot;~&gt; 4.0&quot; , you can see it downloads 4.x.x version.</p><pre>module &quot;parent&quot; {<br>  source = &quot;./modules/parent&quot;<br><br>  vpc_name           = &quot;example-vpc&quot;<br>  vpc_cidr           = &quot;10.0.0.0/16&quot;<br>  azs                = [&quot;us-west-2a&quot;, &quot;us-west-2b&quot;, &quot;us-west-2c&quot;]<br>  vpc_module_version = &quot;~&gt; 4.0&quot;<br>}</pre><p>On init:</p><pre>tfi<br>Initializing modules...<br>Downloading registry.terraform.io/terraform-aws-modules/vpc/aws 4.0.2 for parent.child.vpc...<br>- parent.child.vpc in .terraform/modules/parent.child.vpc<br>Initializing provider plugins found in the configuration...<br>- Reusing previous version of hashicorp/aws from the dependency lock file<br>- Using previously-installed hashicorp/aws v6.34.0<br><br>Initializing the backend...</pre><p>The thing to keep in mind here is that the variables which are passed for source/version should be a constant module variable. Again, the constant module variable term is a little hard to digest ;) The version constraint flows from root → parent → child → registry module. Although I stay away from multiple layers of abstration, this could solve a problem where your private module (which abstracts a child module) doesn&#39;t need to be updated to use a newer version of the child module. Ideally you should be allowing the minor and patch versions to streamthrough anyway.</p><h3>Things to keep in mind</h3><p>So we went through a few scenarios of how this could be used or could come handy.</p><ol><li>The inputs version and source joins count as a reserved keyword.</li><li>Any input which helps support this logical dynamic source allocation needs to have const=true attribute on it.</li><li>The type of module sources ( registry vs git/local) do get inferred earlier in the lifecycle and so swapping them using this feature is not yet possible.</li></ol><h3>Conclusion</h3><p>This definitely is in the list of items I am looking forward to use ( where possible) in some customer environments where module authors could use some more flexibility in terms of module versioning and testing. And I can see how this could come in handy if I have a policy which checks for allowed module sources and I don’t have to parse the HCL block to verify this.</p><h3>References</h3><ul><li><a href="https://github.com/hashicorp/terraform/pull/38217">PR #38217: Implement dynamic module sources</a></li><li><a href="https://github.com/hashicorp/terraform/releases/tag/v1.15.0-alpha20260304">Terraform v1.15.0-alpha20260304 Release</a></li><li><a href="https://github.com/hashicorp/terraform/pull/38146">PR #38146: Add </a><a href="https://github.com/hashicorp/terraform/pull/38146">const attribute to variable blocks</a></li></ul><p><em>Originally published at </em><a href="https://manuchandrasekhar.com/posts/2026/03-04-tf-dynamic-sources/"><em>https://manuchandrasekhar.com</em></a><em> on March 4, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca8da45bb82e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tracing Infrastructure Changes with AWS Provider User Agent header]]></title>
            <link>https://manuchandrasekhar.medium.com/tracing-infrastructure-changes-with-aws-provider-user-agent-header-e9a6356a779b?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9a6356a779b</guid>
            <category><![CDATA[terraform-provider]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 17:18:26 GMT</pubDate>
            <atom:updated>2026-02-16T22:01:49.722Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.allthingsdistributed.com/2016/03/10-lessons-from-10-years-of-aws.html">Failures are a given and everything will eventually fail over time</a>- Werner Vogels, CTO, Amazon.com.</p><p>And when an application goes down or an infrastructure change goes wrong, the first question is always What changed and who changed it ? . On a very high level, CloudTrail as a service gives you the view into the API calls which could have lead to that issue you are investigating. But, connecting that back to a specific deployment, commit , user person requires more context. If you are using Terraform to deploy the AWS workloads in your case , you may have a way to add this additional context. No, I am not talking about tags. I am talking about the user agent mechanism which the provider has - a way to embed custom metadata into every API call Terraform makes.</p><p>Phew User Agent and context and no AI involved !!! This post looks at ways you can introduce this metadata.</p><p>Every AWS API call includes a User-Agent header that identifies the client making the request. The AWS Terraform provider includes information like a sample below:</p><pre>APN/1.0 HashiCorp/1.0 Terraform/1.15.0-alpha20260204 (+https://www.terraform.io) <br>terraform-provider-aws/6.32.1 (+https://registry.terraform.io/providers/hashicorp/aws) <br>aws-sdk-go-v2/1.41.1 ua/2.1 os/macos lang/go#1.25.7 md/GOOS#darwin md/GOARCH#arm64 <br>api/sts#1.41.6 m/v,w  test-infrastructure/1.0.0 (local-test)&quot; tf_aws.sdk=aws-sdk-go-v2 timestamp=2026-02-14T22:48:03.584-0500</pre><p>This tells us that it’s the terraform version, the provider version, and the SDK details — but nothing about <em>your</em> deployment context. You can see this by running terraform plan with debug logging enabled:</p><pre>TF_LOG=DEBUG terraform plan 2&gt;&amp;1 | grep &quot;http.user_agent&quot;</pre><p>From the <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs#custom-user-agent-information">provider documentation</a>, you can see there are three ways to add the additional information you want to :</p><ul><li>The user_agent provider argument.</li><li>The TF_APPEND_USER_AGENT environment variable.</li><li>The provider_meta user_agent argument. # We will discuss this in a second post as it needs a post of its own.</li></ul><blockquote><em>Keeping the focus of this post only on AWS provider though the AWSCC provider also supports it. The use agent data is not passed through to CloudTrail (yet) in case of CloudControl API based calls.</em></blockquote><h3>Provider-Level User Agent</h3><h3>Basic Configuration</h3><pre>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;<br><br>  user_agent = [<br>    &quot;Manu added this&quot;<br>  ]<br>}</pre><p>Let’s see this in action with the latest AWS provider. All you need to do is use the user_agent attribute. For example, the below configuration</p><p>Yields…</p><pre>http.user_agent=&quot;APN/1.0 HashiCorp/1.0 Terraform/1.15.0-alpha20260204 (+https://www.terraform.io) <br> terraform-provider-aws/6.32.1 (+https://registry.terraform.io/providers/hashicorp/aws) <br> aws-sdk-go-v2/1.41.1 ua/2.1 os/macos lang/go#1.25.7 md/GOOS#darwin md/GOARCH#arm64 api/sts#1.41.6 m/v,w <br> Manu added this</pre><h4>1. Provider Argument with Function</h4><blockquote><em>One of the things I have realized over the years is that you learn something new everytime you start diving deep into something you want to write about. What was it this time ? The provider function </em><em>provider::aws::user_agent() . I wasn&#39;t aware this existed .</em></blockquote><p>Lets revise our example to use the function. Keep in mind that the function requires <a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/functions/user_agent">three arguments</a>.</p><pre>  region = &quot;us-east-1&quot;<br><br>  user_agent = [<br>    provider::aws::user_agent(&quot;example-demo&quot;, &quot;0.0.1&quot;, &quot;a comment&quot;),<br>        &quot;other-demo/0.0.2 (other comment)&quot;<br>  ]<br>}</pre><p>This adds example-demo/0.0.1 (a comment) other-demo/0.0.2 (other comment) to every API call&#39;s user agent string. When you run terraform plan, you&#39;ll see:</p><pre>http.user_agent=&quot;APN/1.0 HashiCorp/1.0 Terraform/1.15.0-alpha20260204 <br># removed other pieces for brevity<br>example-demo/0.0.1 (a comment) other-demo/0.0.2 (other comment)&quot;</pre><p>You still get the provider injected metadata and you just added some custom information to the end of it.</p><h4>2. Environment Variable</h4><p>Let’s see how we can do this via the environment variable TF_APPEND_USER_AGENT, but retain the user_agent arg in the provider too.</p><pre>export TF_APPEND_USER_AGENT=&quot;GitHub Actions/sha1235363 BuildID/1234&quot;<br><br># versions.tf<br>provider &quot;aws&quot; {<br>  user_agent = [<br>    provider::aws::user_agent(&quot;example-demo&quot;, &quot;0.0.1&quot;, &quot;a comment&quot;)<br>  ]<br>}</pre><p>Result:</p><pre>APN/1.0 HashiCorp/1.0 Terraform/1.15.0-alpha20260204  # injected by provider<br>example-demo/0.0.1 (a comment)  # injected by `user_agent` input<br>GitHub Actions/sha1235363 BuildID/1234 # injected by `TF_APPEND_USER_AGENT`</pre><p>Where is this useful ? As in my example, you can use it as part of your build system to add the build metadata. If there are changes, you can see the info regarding the build system.</p><h4>3. provider_meta argument</h4><p>What about modules ? ( WHAT ABOUT THEM ?) One of the recommendations or practices when writing modules is to not have the provider block included. So, how would you inject this data that you said was needed or critical?</p><p>The usage analysis of git sourced Terraform modules have always been a pain point for the module authors when it comes to identifying the impact. The Terraform registry based sourcing usually gives you some information with the downloads. For customers I work with , they usualy have private modules in some form of VCS ( GitHub/GitLab etc..). One of the messiest ways I have had to identify this is by forcing the module users to add some common infra_version tag and then writing back to repo or destination as a json document. But this revolves around the users being compliant with it, which can be difficult at times.</p><p>Thats where the provider_meta argument in the terraform block comes in.</p><pre># modules/app/versions.tf<br>terraform {<br>  required_providers {<br>    aws = {<br>      source  = &quot;hashicorp/aws&quot;<br>      version = &quot;~&gt; 6.32&quot;<br>    }<br>  }<br>  <br>  provider_meta &quot;aws&quot; {<br>    user_agent = [&quot;acme-vpc-module/2.1.0&quot;]<br>  }<br>}</pre><blockquote><em>Functions cannot be used in the </em><em>terraform block, so you must format the string manually for </em><em>provider_meta.</em></blockquote><p>Module authors can inject their own user agent information using the provider_meta block. This is particularly useful for:</p><ul><li>Tracking adoption of internal modules across teams</li><li>Debugging issues specific to module versions</li><li>Understanding which module components are most active</li><li>Identifying which teams are using outdated module versions</li></ul><blockquote><em>Note : This is assuming the module authors are able to gather some of this information, especially within an organization. I am not aware of a mechanism currently where a public module author can access this information for their benefit.</em></blockquote><p><strong>Combining provider user_agent and provider_meta</strong></p><p>When you use both the provider-level user_agent and module-level provider_meta, they are <strong>additive</strong> - both appear in the final user agent string.</p><p>Example configuration:</p><pre># Root module<br>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;<br>  user_agent = [<br>    provider::aws::user_agent(&quot;github-actions&quot;, &quot;ww1xx2y&quot;, &quot;development&quot;)<br>  ]<br>}<br><br>module &quot;test&quot; {<br>  source = &quot;./modules/test-module&quot;<br>}<br><br># Module: modules/test-module/main.tf<br>terraform {<br>  provider_meta &quot;aws&quot; {<br>    user_agent = [&quot;test-module/1.0.0&quot;]<br>  }<br>}</pre><p>Results in CloudTrail:</p><pre>http.user_agent=&quot;APN/1.0 HashiCorp/1.0 Terraform/1.15.0-alpha20260204 (+https://www.terraform.io) <br>terraform-provider-aws/6.32.1 (+https://registry.terraform.io/providers/hashicorp/aws) <br>aws-sdk-go-v2/1.41.1 ua/2.1 os/macos lang/go#1.25.7 md/GOOS#darwin md/GOARCH#arm64 api/sts#1.41.6 m/v,w<br>github-actions/ww1xx2y (development) # from the user_agent<br>test-module/1.0.0 # from the provider_meta</pre><p>The module’s provider_meta is appended to the root modules&#39;s user_agent, giving you full traceability from CI system → build version → environment → specific module making the call.</p><h3>Usage patterns</h3><h4>CI/CD Integration</h4><p>Most CI/CD systems expose environment variables you can inject. Taking an example of GitHub actions, keeping default values for the variables which will end up being used when you are doing a deployment from your local machine. You can absolutely add additional identifiers which you team needs.</p><pre># GitHub Actions<br>variable &quot;ci_system&quot; {<br>  description = &quot;CI/CD system name&quot;<br>  type        = string<br>  default     = &quot;local&quot;<br>}<br><br>variable &quot;build_version&quot; {<br>  description = &quot;Build or commit version&quot;<br>  type        = string<br>  default     = &quot;dev&quot;<br>}<br><br>variable &quot;environment&quot;{<br>  description = &quot;Environment&quot;<br>  type        = string<br>  default     = &quot;development&quot;<br>}<br><br>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;<br><br>  user_agent = [<br>    provider::aws::user_agent(<br>      var.ci_system,<br>      var.build_version,<br>      var.environment<br>    )<br>  ]<br>}</pre><p>In your GitHub Actions workflow, there are <a href="https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables">default environment variables</a> you can bank on.</p><pre>- name: Terraform Apply<br>  env:<br>    TF_VAR_ci_system: &quot;github-actions&quot;<br>    TF_VAR_build_version: $GITHUB_SHA<br>    TF_VAR_environment: &quot;staging&quot;<br>  run: terraform apply -auto-approve</pre><p>Now every API call includes the exact commit and environment. When you run this, the user agent will show:</p><pre>http.user_agent=&quot;... github-actions/abc123f&quot;</pre><blockquote><em>For GitLab CI/CD, use the </em><a href="https://docs.gitlab.com/ci/variables/predefined_variables/"><em>pre-defined variables</em></a><em> to inject via those pipelines.</em></blockquote><pre># .gitlab-ci.yml<br>terraform:apply:<br>  script:<br>    - export TF_VAR_ci_system=&quot;gitlab-ci&quot;<br>    - export TF_VAR_build_version=$CI_COMMIT_SHORT_SHA<br>    - export TF_VAR_environment=&quot;staging&quot;<br>    - terraform apply -auto-approve</pre><blockquote><em>Local deployment , the variables use the default values ( unless explicitly overridden) and gives us the local/dev combination.</em></blockquote><h3>Querying CloudTrail</h3><p>Let’s see how this ends up on the AWS account side, specifically CloudTrail.</p><h3>Finding Recent Terraform Operations</h3><pre># Get the most recent GetCallerIdentity event with user agent<br>aws cloudtrail lookup-events \<br>    --lookup-attributes AttributeKey=EventName,AttributeValue=GetCallerIdentity \<br>    --max-items 1 \<br>    --region us-east-1 \<br>    --query &#39;Events[0].CloudTrailEvent&#39; | jq -r &#39;fromjson | .userAgent&#39;</pre><p>This returns the full user agent string:</p><pre>APN/1.0 HashiCorp/1.0 Terraform/1.15.0-alpha20260204 (+https://www.terraform.io) terraform-provider-aws/6.32.1 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go-v2/1.41.1 ua/2.1 os/macos lang/go#1.25.7 md/GOOS#darwin md/GOARCH#arm64 api/sts#1.41.6 m/v,w <br>local/dev (development) # from our local tf vars</pre><h3>Extracting Just the Custom Component</h3><p>Kiro to the rescue. I wanted to find if I can get just the custom agent metadata I added.</p><pre># Extract only the custom user agent portion<br>aws cloudtrail lookup-events \<br>    --lookup-attributes AttributeKey=EventName,AttributeValue=GetCallerIdentity \<br>    --max-items 1 \<br>    --region us-east-1 \<br>    --query &#39;Events[0].CloudTrailEvent&#39; | jq -r &#39;fromjson | .userAgent&#39; | grep -o &#39;[a-z-]*/[^ ]* ([^)]*)&#39; | tail -1bash</pre><p>Output:</p><pre>local/dev (development)</pre><h3>Analysis options</h3><h3>Sample Dashboard</h3><p>Asking CloudWatch to create the dashboard based on some of the metadata was the harder portion. Kiro CLI helped out with the insights queries in this case and a sample is below. I resorted to keep some information like resource deletion and IAM policy changes up top in the dashboard which I feel is something you would want to be aware of.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Dn0xRog88Q1R6ooE.png" /></figure><h3>CloudTrail MCP server</h3><p>With the recent MCP explosion, investigation of these issues are easier with a prompt as well. But what we miss is the metadata which can help source the actions better. From the deployments I initiated, what if I ask about the queue I know was deleted ?</p><p><strong>Scenario 1</strong></p><pre>When was the SQS queue task-queue deleted and how/who ?<br>..<br>Running tool lookup_events with the param (from mcp server: awslabs.cloudtrail-mcp-server)<br> ⋮  {<br> ⋮    &quot;attribute_key&quot;: &quot;EventName&quot;,<br> ⋮    &quot;attribute_value&quot;: &quot;DeleteQueue&quot;,<br> ⋮    &quot;max_results&quot;: 50,<br> ⋮    &quot;start_time&quot;: &quot;90 days ago&quot;<br> ⋮  }<br> - Completed in 0.884s<br><br>&gt; The SQS queue task-queue was deleted on February 15, 2026 at 11:44:48 AM EST (16:44:48 UTC).<br><br>How/Who:<br>- **User**: github-role (via IAM role Admin)<br>- **Method**: Terraform destroy via AWS provider<br>- **Tool**: Terraform 1.15.0-alpha20260204 with AWS provider 6.32.1<br>- **CI System**: github-actions<br>- **Build Version**: qq7rr8s<br>- **Additional metadata**: developmentbas</pre><p>May be we should add some more information in the the third comment for better utilize for investigations.</p><p><strong>Scenario 2</strong></p><pre>Identify the number of times and versions of &quot;test-module&quot; is used in resource management using CloudTrail. You can check GetCallerIdentity for example.<br><br>&gt; CloudTrail Lake hasn&#39;t ingested the recent events yet. Let me use lookup_events which queries the last 90<br>days directly:<br>Running tool lookup_events with the param (from mcp server: awslabs.cloudtrail-mcp-server)<br> ⋮  {<br> ⋮    &quot;attribute_key&quot;: &quot;EventName&quot;,<br> ⋮    &quot;attribute_value&quot;: &quot;GetCallerIdentity&quot;,<br> ⋮    &quot;max_results&quot;: 50,<br> ⋮    &quot;region&quot;: &quot;us-east-1&quot;,<br> ⋮    &quot;start_time&quot;: &quot;1 day ago&quot;<br> ⋮  }<br> - Completed in 1.574s<br><br>&gt; Perfect! Now let me extract and count the test-module versions from the user agents:<br><br>Version breakdown:<br>  test-module/1.0.0: 4 calls<br>  test-module/1.0.1: 2 calls<br>  test-module/1.1.0: 1 calls<br> - Completed in 1.272s<br><br>&gt; ## Summary<br><br>3 versions of &quot;test-module&quot; are being used in resource management:<br><br>### Version Usage:<br>1. test-module/1.0.0 - 4 API calls (most used)<br>2. test-module/1.0.1 - 2 API calls<br>3. test-module/1.1.0 - 1 API call<br><br>### Timeline:<br>- **15:52:29** - test-module/1.0.0 (deployment-v1)<br>- **15:52:47** - test-module/1.0.1 (deployment-v2, 2 calls)<br>- **15:53:04** - test-module/1.1.0 (deployment-v3)<br><br>Additional earlier usage of test-module/1.0.0 was found at 15:42:50, 15:37:49, and 15:29:35, indicating the<br>module was tested multiple times before the final deployments.</pre><blockquote><em>I will have to revisit this with some more solid examples of module usage to refine my own prompt. But extrapolating the dashboard to give you information on the provider_meta data shouldn’t be harder.</em></blockquote><h3>Hypothetical : incident analysis</h3><p>Here’s how this could help during an incident:</p><p><strong>Scenario</strong>: An S3 bucket’s public access settings were unexpectedly changed at 3:47 PM.</p><p><strong>Without User Agent Context</strong>:</p><pre>CloudTrail shows: PutBucketPublicAccessBlock called by terraform-assumed-role</pre><p>Back to the drawing board and looking at the application repos and finding the time of deployment ( if done via CICD ) and try to co-relate.</p><p><strong>With User Agent Context</strong>:</p><pre>CloudTrail shows: <br>User-Agent: ... github-actions/22030165088 (37e04a2-deploy-production)</pre><p>Now you can:</p><ol><li>Go directly to GitHub Actions run #22030165088</li><li>See the exact commit (37e04a2)</li><li>Review the PR that introduced the change</li><li>Identify the folks involved in the authoring and approval stage to understand the intent of the change.</li></ol><p>You might be wondering: “Can’t I just use AWS tags to track this information?” I feel they are supplementary to each other while user-agent can answe deployment provenace while tags can answer resource classification.</p><p>Thinking out loud..</p><ul><li>Not all AWS resources support tags</li><li>Failed API calls will still carry the user-agent while the operation never succeeded while leading to some issues.</li><li>Delete a resource and the metadata around that is almost gone ( you can probably figure out some details using may be Config) , but CloudTrail retains User-Agent data</li><li>Tags can be modified or removed after deployment, breaking the audit trail.</li></ul><h3>Conclusion</h3><p>The AWS provider’s custom user agent mechanism helps us to enable an additional layer of observability into the infrastructure lifecycle management. By embedding deployment context — CI/CD run IDs, commit SHAs, and any other metadata that you need — you create a direct link between infrastructure changes and the code that caused them.</p><h3>References</h3><ul><li><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs#user_agent">AWS Provider User Agent Configuration</a></li><li><a href="https://developer.hashicorp.com/terraform/language/providers/requirements#provider-meta">Terraform Provider Meta</a></li><li><a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html">CloudTrail Event Reference</a></li><li><a href="https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables">GitHub Actions Environment Variables</a></li><li><a href="https://docs.gitlab.com/ee/ci/variables/predefined_variables.html">GitLab Predefined Variables</a></li></ul><p><em>Originally published at </em><a href="https://manuchandrasekhar.com/posts/2026/02-15-aws-provider-user-agent/"><em>https://manuchandrasekhar.com</em></a><em> on February 15, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9a6356a779b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding agent skills for Terraform]]></title>
            <link>https://manuchandrasekhar.medium.com/adding-agent-skills-for-terraform-fde7a164fcc8?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fde7a164fcc8</guid>
            <category><![CDATA[skills]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 06:45:36 GMT</pubDate>
            <atom:updated>2026-02-14T14:02:00.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fo_jLcj1uzL5eIwX.png" /></figure><p>MCP exploded. There is no better way to say that. Every developer I knew had at least a handful of those MCP servers running with their coding agents. But the context overload with all those was massive and I found myself seeing messages around context overflow a fair few times. I know for a fact that most of the MCP servers I have enabled and the tool definitions they have were not needed to be read by the agent all the time.</p><p>So how do I solve this context bloat while ensuring I can give all the necessary information required for the model to give me that desired result? I have been hearing or reading about a few things which could help:</p><ul><li>Skills ( was a Claude-only thing till it was made an open spec)</li><li>Powers in kiro ( an IDE based approach and not yet in kiro CLI)</li><li>Code execution with MCP server ( Maybe for another post)</li></ul><p>The curiosity around skills peaked with <a href="https://github.com/antonbabenko/terraform-skill">Anton’s terraform skills</a> and the official <a href="https://github.com/hashicorp/agent-skills">HashiCorp agent skills</a>. My experience with using it with kiro CLI is documented <a href="https://manuchandrasekhar.com/posts/2026/01-27-kiro-terraform-skills/">here</a>. But how do you create your own skill if one doesn’t exist ? The process of testing and refining a new skill turned into a great learning experience about how these skills work in practice.</p><h3>So what’s the problem statement?</h3><p>I need a mechanism to effectively inform my agent to create the desired configuration to help bring existing cloud resources under Terraform management. If you hear, the first thing that comes to mind ( and should ) is import statements or blocks. The terraform-search-import skill I am discussing here aims to address that challenge. I do feel there is a need for No so green field series on infrastructure management.</p><p>So how do did end up here ? Most organizations have infrastructure that wasn’t originally created with Terraform:</p><ul><li>Resources created through AWS Console, CLI, or other tools during some POC phase OR</li><li>Legacy infrastructure that predates Infrastructure as Code adoption</li></ul><p>Traditionally, importing these resources into Terraform required:</p><ol><li><strong>Manual discovery</strong> — Finding all resources across your cloud accounts</li><li><strong>Manual configuration writing</strong> — Creating HCL resource blocks for each resource</li><li><strong>Manual import commands</strong> — Running terraform import for each resource individually</li><li><strong>Trial and error</strong> — Getting the resource configuration exactly right</li></ol><p>This process is time-consuming, error-prone, and doesn’t scale when you have dozens or hundreds of resources. Terraform introduced a step by step improvement on this approach with the config driven imports and then with Terraform search. The intention with the skill is to handle these scenarios based on the user situation and version constraints they may have.</p><h3>How does it work ?</h3><p>Ideally, the pre-requisites around the version constraints are met and a user is able to leverage this skill to use Terraform’s new Search functionality to automate the discovery and import:</p><ol><li><strong>Automated Discovery</strong>: Uses .tfquery.hcl files to query for existing resources. These are provider dependent and not every provider has every list provider possible. AWSCC provider is an exception with support for more than 100s of resources.</li><li><strong>Automated Generation</strong>: Creates Terraform resource blocks with current configurations automatically</li><li><strong>Config driven import method</strong>: Generates import blocks using the terraform query subcommands.</li></ol><p>I already had documented some instructions which I was using my agents to help import existing resources. All it needed was identifying the agent skills structure and then porting the necessary instructions when needed.</p><h3>Adding the Skill</h3><p>For testing, I needed to set up the terraform-search-import skill in my local Kiro environment. Since this was a new skill which doesn&#39;t exist in the upstream package, I had to create it from scratch following the agent skill specification and using existing skills as reference. To be honest, the skills documentation is pretty straightforward when it comes to guiding you on what is expected.</p><blockquote><em>Note : If your </em><em>SKILL.md file is growing with examples and lots of external references, you should look at adding them under a directory called </em><em>references. Agent skill specifications are able to load these reference documents in a lazy manner. Only when they are needed. This helps to reduce the context which is made available to the model. Overload of information doesn&#39;t always translate to the best results.</em></blockquote><p>Below were some of the steps specifically for kiro as the CLI references the skill documents as Skill resources.</p><ol><li>Create the skill directory structure:</li></ol><ul><li>mkdir -p ~/.kiro/agents/terraform-search-import/references</li></ul><ol><li>Create the main skill file ( SKILL.md) with proper YAML frontmatter:</li></ol><pre>---<br>name: terraform-search-import<br>description: Discover existing cloud resources using Terraform Search queries and bulk import them into Terraform management. Use when bringing unmanaged infrastructure under Terraform control, auditing cloud resources, or migrating to IaC.<br>---</pre><ol><li>Add any supporting documentation or examples in the references/ directory.</li></ol><p>Let’s be honest . Did I start this way ? Not really. I had 500+ lines of information in my original SKILL.md file. One of the redundant items in my original SKILL.md file were the scenarios I wanted to cover.</p><ul><li>Scenario where the list resource existed for a provider.</li><li>Where a list resource didn’t exist for the resource in a provider.</li><li>Where the Terraform version if below the required 1.14.0 version.</li></ul><h3>What list resources are supported ?</h3><p>How can we solve this ?</p><ul><li>Well, you could have the Terraform MCP server look for the resources everytime we needed against a provider. OR</li><li>Look at the <a href="https://github.com/quixoticmonk/extract-provider-supported-actions/blob/main/list-resources-report.json">supported list resources</a> I maintain as an automated workflow. OR</li><li>Execute a deterministic script agains the providers in question.</li></ul><p>If you look at the <a href="https://agentskills.io/specification">Agent Skills specification</a>, there is an additional optional directory a skill can hold.</p><p>The repository I linked above for my list of provider supported list resources were essentially banking on the terraform providers schema json file. The script in the repository identified the list/action resources for each provider schema we fed into the script. How do we get that ? Add a provider block into a .tf file and run terraform init.</p><p>So what if I moved the list resource discovery into a deterministic script ? So the MCP server doesn’t need to do this either.</p><h3>Testing the Skill in Practice</h3><p>So we have the following resources in the directory kiro CLI is expecting them to be in :</p><ul><li>SKILL.md file</li><li>/references for edge cases and additional scenarios</li><li>/scripts to hold scripts( if needed)</li></ul><p>Copying this into the .kiro/agents/skills directory is all I needed to have kiro-cli identify it as an available skill on the next session. It helps that the agent configuration was using wild characters in the skills resource block.</p><pre>&quot;resources&quot;: [&quot;skill://~/.kiro/skills/**/SKILL.md&quot;]</pre><h3>Actual tests</h3><p>Lets run through couple of scenarios.</p><h4>Test 1 : Supported resources and TF version above 1.14.0</h4><p>With the skill created and installed( or added to the directory ), I tested it with the request “Create the terraform configuration for importing the S3 buckets from my AWS account.”</p><p>Here’s the complete session log:</p><pre>Create the terraform configuration for importing the S3 buckets from my AWS account.<br>I&#39;ll help you create Terraform configuration to import existing S3 buckets from your AWS account. Let me use the terraform-search-import skill to discover and import<br>your S3 buckets.<br>Reading file: /Users/user_name/.kiro/skills/terraform-search-import/SKILL.md, all lines (using tool: read)<br>Allow this action? Use &#39;t&#39; to trust (always allow) this tool for the session. [y/n/t]:<br><br>[iac] &gt; t<br><br>✓ Successfully read 9116 bytes from /Users/user_name/.kiro/skills/terraform-search-import/SKILL.md<br><br>Completed in 0.1s<br>Now I&#39;ll create a minimal Terraform configuration to discover and import your S3 buckets. First, let me check what list resources are available for the AWS provider:<br>I&#39;ll create the following file: /Users/user_name/Documents/2026/experiments/agent-skills/terraform.tf (using tool: write)<br>Purpose: Create basic Terraform configuration with AWS provider<br><br>1: terraform {<br>2: required_version = &quot;&gt;= 1.14&quot;<br>3: required_providers {<br>4: aws = {<br>5: source = &quot;hashicorp/aws&quot;<br>6: version = &quot;~&gt; 6.0&quot;<br>7: }<br>8: }<br>9: }<br>Allow this action? Use &#39;t&#39; to trust (always allow) this tool for the session. [y/n/t]:<br><br>[iac] &gt; t<br><br>Creating: /Users/user_name/Documents/2026/experiments/agent-skills/terraform.tf<br><br>Completed in 0.3s<br>I will run the following command: cd /Users/user_name/Documents/2026/experiments/agent-skills &amp;&amp; terraform init (using tool: shell)<br>Purpose: Initialize Terraform to download AWS provider<br><br>Allow this action? Use &#39;t&#39; to trust (always allow) this tool for the session. [y/n/t]:<br><br>[iac] &gt; t<br><br>Initializing the backend...<br>Initializing provider plugins...<br><br>Finding hashicorp/aws versions matching &quot;~&gt; 6.0&quot;...<br>Installing hashicorp/aws v6.31.0...<br>Installed hashicorp/aws v6.31.0 (signed by HashiCorp)<br>Terraform has created a lock file .terraform.lock.hcl to record the provider<br>selections it made above. Include this file in your version control repository<br>so that Terraform can guarantee to make the same selections by default when<br>you run &quot;terraform init&quot; in the future.<br>Terraform has been successfully initialized!<br><br>You may now begin working with Terraform. Try running &quot;terraform plan&quot; to see<br>any changes that are required for your infrastructure. All Terraform commands<br>should now work.<br><br>If you ever set or change modules or backend configuration for Terraform,<br>rerun this command to reinitialize your working directory. If you forget, other<br>commands will detect it and remind you to do so if necessary.<br><br>Completed in 25.674s<br>Now let me check what list resources are available for S3:<br>I will run the following command: cd /Users/user_name/Documents/2026/experiments/agent-skills &amp;&amp; terraform providers schema -json | jq &#39;.provider_schemas.&quot;registry.terraform.io/hashicorp/aws&quot;.list_resource_schemas | keys | .[]&#39; | grep -i s3 (using tool: shell)<br>Purpose: Check if S3 bucket list resources are supported<br><br>&quot;aws_s3_bucket&quot;<br>&quot;aws_s3_bucket_acl&quot;<br>&quot;aws_s3_bucket_policy&quot;<br>&quot;aws_s3_bucket_public_access_block&quot;<br>&quot;aws_s3_object&quot;<br><br>Completed in 2.69s<br>Great! The AWS provider supports aws_s3_bucket list resources. Now I&#39;ll create the query file to discover your S3 buckets:<br>I&#39;ll create the following file: /Users/user_name/Documents/2026/experiments/agent-skills/discovery.tfquery.hcl (using tool: write)<br>Purpose: Create Terraform query file to discover all S3 buckets<br><br>1: provider &quot;aws&quot; {<br>2: region = &quot;us-east-1&quot;<br>3: }<br>4:<br>5: list &quot;aws_s3_bucket&quot; &quot;all&quot; {<br>6: provider = aws<br>7: }<br>Creating: /Users/user_name/Documents/2026/experiments/agent-skills/discovery.tfquery.hcl<br><br>Completed in 0.1s<br>Now let&#39;s run the query to discover your S3 buckets:<br>I will run the following command: cd /Users/user_name/Documents/2026/experiments/agent-skills &amp;&amp; terraform query (using tool: shell)<br>Purpose: Execute Terraform query to discover S3 buckets<br><br>list.aws_s3_bucket.all account_id=############,bucket=agentcore-cicd-terraform-state-d1f38556,region=us-east-1 agentcore-cicd-terraform-state-d1f38556<br>list.aws_s3_bucket.all account_id=############,bucket=aws-glue-assets-############-us-east-1,region=us-east-1 aws-glue-assets-############-us-east-1<br>list.aws_s3_bucket.all account_id=############,bucket=awscc-tool-use-2fqr-assets,region=us-east-1 awscc-tool-use-2fqr-assets<br>list.aws_s3_bucket.all account_id=############,bucket=bedrock-s3-kb,region=us-east-1 bedrock-s3-kb<br>list.aws_s3_bucket.all account_id=############,bucket=bedrock-video-generation-us-east-1-ymeqc5,region=us-east-1 bedrock-video-generation-us-east-1-ymeqc5<br><br>Completed in 76.725s<br>Perfect! Now let&#39;s generate the Terraform configuration for importing all these S3 buckets:<br>I will run the following command: cd /Users/user_name/Documents/2026/experiments/agent-skills &amp;&amp; terraform query -generate-config-out=s3-buckets.tf (using tool: shell)<br>Purpose: Generate Terraform configuration for importing S3 buckets<br><br>list.aws_s3_bucket.all account_id=############,bucket=agentcore-cicd-terraform-state-d1f38556,region=us-east-1 agentcore-cicd-terraform-state-d1f38556<br>list.aws_s3_bucket.all account_id=############,bucket=aws-glue-assets-############-us-east-1,region=us-east-1 aws-glue-assets-############-us-east-1<br>list.aws_s3_bucket.all account_id=############,bucket=awscc-tool-use-2fqr-assets,region=us-east-1 awscc-tool-use-2fqr-assets<br>list.aws_s3_bucket.all account_id=############,bucket=bedrock-s3-kb,region=us-east-1 bedrock-s3-kb<br>list.aws_s3_bucket.all account_id=############,bucket=bedrock-video-generation-us-east-1-ymeqc5,region=us-east-1 bedrock-video-generation-us-east-1-ymeqc5<br>list.aws_s3_bucket.all account_id=############,bucket=cdk-hnb659fds-assets-############-us-east-1,region=us-east-1 cdk-hnb659fds-assets-############-us-east-1<br>list.aws_s3_bucket.all account_id=############,bucket=cf-templates-1xfr5l1bee3rm-us-east-1,region=us-east-1 cf-templates-1xfr5l1bee3rm-us-east-1<br><br>Completed in 57.567s<br>Let me check the generated configuration file:<br>Reading file: /Users/user_name/Documents/2026/experiments/agent-skills/s3-buckets.tf, from line 1 to 50 (using tool: read)<br>✓ Successfully read 1221 bytes from /Users/user_name/Documents/2026/experiments/agent-skills/s3-buckets.tf<br><br>Completed in 0.0s<br>Perfect! I&#39;ve successfully created a Terraform configuration to import all your S3 buckets. Here&#39;s what was generated:<br><br>Files Created:<br>terraform.tf - Provider configuration<br>discovery.tfquery.hcl - Query file to discover S3 buckets<br>s3-buckets.tf - Generated configuration with 36 S3 buckets and their import blocks<br>What&#39;s Included:<br>Resource blocks for all 36 S3 buckets in your account<br>Import blocks using identity-based import (Terraform 1.12+)<br>All current bucket configurations including tags, settings, and timeouts<br>Next Steps:<br>Review the generated configuration in s3-buckets.tf<br>Clean up the configuration by removing computed attributes and null values<br>Run the import:<br>bash<br>terraform plan<br>terraform apply<br>The configuration includes buckets for various services like:<br><br>Terraform state buckets<br>AWS service buckets (Glue, SageMaker, CodePipeline)<br>Application buckets<br>CDK and CloudFormation assets<br>All buckets are ready to be imported into Terraform state management using the modern identity-based import method.</pre><p>The entire process took about 2 minutes and successfully discovered 36 S3 buckets across my account, generating complete Terraform configuration ready for import.</p><h4>Test 2 : TF version below 1.14.0</h4><pre>Write the necessary Terraform configuration to import my existing S3 buckets from the AWS account into Terraform management. The S3 buckets to import have a prefix of awscc-tool. <br><br>&gt; I&#39;ll help you import your existing S3 buckets with the &quot;awscc-tool&quot; prefix into Terraform management. Let me use the terraform-search-import skill to discover and<br>import these resources.<br>Reading file: /Users/manuchn/.kiro/skills/terraform-search-import/SKILL.md, all lines (using tool: read)<br> ✓ Successfully read 8591 bytes from /Users/manuchn/.kiro/skills/terraform-search-import/SKILL.md<br> - Completed in 0.0s<br><br>&gt; Now I&#39;ll check what list resources are available for S3 buckets and create the necessary configuration to discover and import your S3 buckets with the &quot;awscc-tool&quot;<br>prefix.<br>I will run the following command: terraform version (using tool: shell)<br>Purpose: Check Terraform version to ensure it supports Terraform Search (requires &gt;= 1.14)<br><br>Terraform v1.13.0<br>on darwin_arm64<br>+ provider registry.terraform.io/hashicorp/aws v6.31.0<br><br>Your version of Terraform is out of date! The latest version<br>is 1.14.4. You can update by downloading from https://developer.hashicorp.com/terraform/install<br> - Completed in 0.136s<br><br>&gt; Since your Terraform version is 1.13.0 (below the required 1.14 for Terraform Search), I&#39;ll use the AWS CLI approach to discover your S3 buckets and generate the<br>import configuration manually.<br>Running aws cli command (using tool: aws):<br><br>Service name: s3api<br>Operation name: list-buckets<br>Parameters:<br>Region: us-east-1<br>Label: List all S3 buckets to find ones with awscc-tool prefix - Completed in 2.165s<br><br>&gt; Perfect! I found 3 S3 buckets with the &quot;awscc-tool&quot; prefix:<br>1. awscc-tool-use-2fqr-assets<br>2. awscc-tool-use-ezct-artifacts<br>3. awscc-tool-use-ezct-assets</pre><p>It correctly identified that the Terraform version was below 1.14.0 and the query command wouldn’t be supported in that case. I skipped the rest of the steps in the snippet above as kiro went on to add the config driven import blocks based on the names retrieved with the S3 API.</p><p>As a non-native English speaker, I do struggle with finding the right balance in my writing- either over-explaniing or being too brief.So how do I make this effective ? This is an area I didn’t have any experience or idea about. The <a href="https://www.hashicorp.com/en/blog/introducing-hashicorp-agent-skills">HashiCorp blog </a>about the agent-skills mentioned <a href="https://tessl.io/">tessl</a> being used to evaluate and improve the skills they had written. So after the initial bit of testing with the copied skill, I started looking at tessl.</p><p>You have a few ways to do this <a href="https://docs.tessl.io/evaluate/evaluating-skills">evaluation</a>. If you use the tessl npm package, you can publish the skill on to the registry which is auto evaluated. Or as in my case, run the evaluation locally since I am submitting this as an additional skill to the existing agent-skills bundle under HashiCorp namespace.</p><p>As you would have figured, I went the latter route.</p><h3>Installation</h3><p>As with any npm library, it is as simple as :</p><pre>npm install -g @tessl/cli</pre><h3>Review</h3><p>Let’s review using the tessl skill review command.</p><pre>&gt; tessl skill review  ~/.kiro/skills/terraform-search-import<br><br>Validation Checks<br><br>  ✔ skill_md_line_count - SKILL.md line count is 374 (&lt;= 500)<br>  ✔ frontmatter_valid - YAML frontmatter is valid<br>  ✔ name_field - &#39;name&#39; field is valid: &#39;terraform-search-import&#39;<br>  ✔ description_field - &#39;description&#39; field is valid (227 chars)<br>  ✔ description_voice - &#39;description&#39; uses third person voice<br>  ✔ description_trigger_hint - Description includes an explicit trigger hint<br>  ✔ compatibility_field - &#39;compatibility&#39; field is valid (104 chars)<br>  ✔ allowed_tools_field - &#39;allowed-tools&#39; field not present (optional)<br>  ✔ metadata_version - &#39;metadata.version&#39; is present: 0.1.0<br>  ✔ metadata_field - &#39;metadata&#39; contains 2 entries<br>  ⚠ license_field - &#39;license&#39; field is missing<br>  ✔ frontmatter_unknown_keys - No unknown frontmatter keys found<br>  ✔ body_present - SKILL.md body is present<br>  ✔ body_examples - Examples detected (code fence or &#39;Example&#39; wording)<br>  ✔ body_output_format - Output/return/format terms detected<br>  ✔ body_steps - Step-by-step structure detected (ordered list)<br><br>Overall: PASSED (0 errors, 1 warnings)<br><br>Judge Evaluation<br><br>  Description: 100%<br>    specificity: 3/3 - Lists multiple specific concrete actions: &#39;Discover existing cloud resources&#39;, &#39;Terraform Search queries&#39;, &#39;bulk import them into Terraform management&#39;. These are clear, actionable capabilities.<br>    trigger_term_quality: 3/3 - Includes natural keywords users would say: &#39;cloud resources&#39;, &#39;Terraform&#39;, &#39;import&#39;, &#39;unmanaged infrastructure&#39;, &#39;IaC&#39;, &#39;auditing&#39;, &#39;migrating&#39;. Good coverage of terms for infrastructure-as-code workflows.<br>    completeness: 3/3 - Clearly answers both what (&#39;Discover existing cloud resources using Terraform Search queries and bulk import them&#39;) AND when (&#39;Use when bringing unmanaged infrastructure under Terraform control, auditing cloud resources, or migrating to IaC&#39;).<br>    distinctiveness_conflict_risk: 3/3 - Clear niche focused specifically on Terraform import/discovery workflows. The combination of &#39;Terraform Search&#39;, &#39;bulk import&#39;, and &#39;unmanaged infrastructure&#39; creates distinct triggers unlikely to conflict with general Terraform or cloud skills.<br><br>    Assessment: This is a well-crafted skill description that excels across all dimensions. It provides specific actions (discover, search, bulk import), includes natural trigger terms users would actually say, explicitly states both capabilities and usage scenarios, and carves out a distinct niche within the Terraform ecosystem focused on import workflows.<br><br>  Content: 77%<br>    conciseness: 2/3 - The content is mostly efficient but includes some redundancy - the workflow is explained multiple times (overview section, then detailed sections, then complete example). Some sections like &#39;When to Use&#39; list items that are somewhat obvious given the skill description.<br>    actionability: 3/3 - Excellent executable examples throughout - complete HCL configurations, bash commands, and a full end-to-end workflow example. Code is copy-paste ready with realistic values and clear syntax.<br>    workflow_clarity: 3/3 - Clear 5-step workflow with explicit sequence. Includes validation checkpoint (&#39;Review and refine generated resource and import blocks&#39;) and the &#39;Best Practices&#39; section emphasizes running plan before apply and backing up state. The complete example at the end reinforces the workflow.<br>    progressive_disclosure: 2/3 - Good structure with clear sections and a reference table, but the content is quite long (~300 lines) and could benefit from splitting detailed examples or the troubleshooting table into separate reference files. The external references at the top are appropriate but internal organization could be improved.<br><br>    Assessment: This is a well-structured, highly actionable skill with excellent executable examples and clear workflow guidance. The main weakness is length - the content could be more concise by removing some redundancy (workflow explained multiple times) and potentially splitting detailed reference material into separate files. The safety considerations around state management are appropriately emphasized.<br><br>    Suggestions:<br>      - Consider moving the detailed &#39;Query Examples&#39; section to a separate EXAMPLES.md file and keeping only 1-2 examples inline<br>      - Remove the &#39;When to Use&#39; section as it duplicates the skill description and is self-evident from the content<br><br>Average Score: 89%<br><br>✔ Skill evaluation completed successfully!</pre><p>Not bad for an initial skill reference. Re-run after making some changes it suggested.</p><pre>❯ tessl skill review  ~/.kiro/skills/terraform-search-import<br><br>Validation Checks<br><br>  ✔ skill_md_line_count - SKILL.md line count is 369 (&lt;= 500)<br>  ✔ frontmatter_valid - YAML frontmatter is valid<br>  ✔ name_field - &#39;name&#39; field is valid: &#39;terraform-search-import&#39;<br>  ✔ description_field - &#39;description&#39; field is valid (227 chars)<br>  ✔ description_voice - &#39;description&#39; uses third person voice<br>  ✔ description_trigger_hint - Description includes an explicit trigger hint<br>  ✔ compatibility_field - &#39;compatibility&#39; field is valid (104 chars)<br>  ✔ allowed_tools_field - &#39;allowed-tools&#39; field not present (optional)<br>  ✔ metadata_version - &#39;metadata.version&#39; is present: 0.1.0<br>  ✔ metadata_field - &#39;metadata&#39; contains 2 entries<br>  ⚠ license_field - &#39;license&#39; field is missing<br>  ✔ frontmatter_unknown_keys - No unknown frontmatter keys found<br>  ✔ body_present - SKILL.md body is present<br>  ✔ body_examples - Examples detected (code fence or &#39;Example&#39; wording)<br>  ✔ body_output_format - Output/return/format terms detected<br>  ✔ body_steps - Step-by-step structure detected (ordered list)<br><br>Overall: PASSED (0 errors, 1 warnings)<br><br>Judge Evaluation<br><br>  Description: 100%<br>    specificity: 3/3 - Lists multiple specific concrete actions: &#39;Discover existing cloud resources&#39;, &#39;Terraform Search queries&#39;, &#39;bulk import them into Terraform management&#39;. These are clear, actionable capabilities.<br>    trigger_term_quality: 3/3 - Includes natural keywords users would say: &#39;cloud resources&#39;, &#39;Terraform&#39;, &#39;import&#39;, &#39;unmanaged infrastructure&#39;, &#39;IaC&#39;, &#39;auditing&#39;, &#39;migrating&#39;. Good coverage of terms for infrastructure-as-code workflows.<br>    completeness: 3/3 - Clearly answers both what (&#39;Discover existing cloud resources using Terraform Search queries and bulk import them&#39;) AND when (&#39;Use when bringing unmanaged infrastructure under Terraform control, auditing cloud resources, or migrating to IaC&#39;).<br>    distinctiveness_conflict_risk: 3/3 - Clear niche focused specifically on Terraform import/discovery workflows. The combination of &#39;Terraform Search&#39;, &#39;bulk import&#39;, and &#39;unmanaged infrastructure&#39; creates distinct triggers unlikely to conflict with general Terraform or cloud skills.<br><br>    Assessment: This is a well-crafted skill description that excels across all dimensions. It provides specific actions (discover, search, bulk import), includes natural trigger terms users would actually say, explicitly states both capabilities and usage scenarios, and carves out a distinct niche within the Terraform ecosystem focused on import workflows.<br>  Content: 85%<br>    conciseness: 2/3 - The content is mostly efficient but includes some redundancy - the prerequisites section repeats the discovery script information, and some explanations (like the query output format) could be more compact. The post-generation cleanup section with before/after examples is valuable but slightly verbose.<br>    actionability: 3/3 - Excellent executable guidance throughout with complete, copy-paste ready HCL configurations and bash commands. The complete example at the end provides a full workflow with real commands. All code blocks are executable, not pseudocode.<br>    workflow_clarity: 3/3 - Clear decision tree upfront, explicit 5-step workflow, and the complete example shows the exact sequence with validation steps (terraform plan before apply). The &#39;Check Provider Support First&#39; section with IMPORTANT callout establishes a critical validation checkpoint before proceeding.<br>    progressive_disclosure: 3/3 - Well-structured with clear sections progressing from prerequisites to basic to advanced usage. References external documentation appropriately (HashiCorp docs, MANUAL-IMPORT.md for unsupported resources). Content is appropriately organized without being monolithic or requiring deep navigation.<br><br>    Assessment: This is a strong, well-structured skill that provides actionable guidance for Terraform resource discovery and bulk import. The decision tree and explicit workflow steps make it easy to follow, and the code examples are complete and executable. Minor verbosity in some sections (prerequisites, cleanup examples) prevents a perfect conciseness score, but overall the content earns its place.<br><br>Average Score: 93%<br><br>✔ Skill evaluation completed successfully!</pre><p>I left it there without over optimizing it based on some feedback notes I saw. Why do I feel this is important ? Working with an open spec, a tool like this can guide you on how you can make your skills effective. Keep your tests handy and re-run after changes you make. Sometimes it is just a change in order which makes a world of difference.</p><h3>Learnings</h3><ul><li>If I have to start on a new agent skill tomorrow ( without some basline ) I would probably one of the below approaches:</li><li>tessl gives you tessl skill new workflow with the npm library to get you started.</li><li>Anthropic gives you a <a href="https://skills.sh/anthropics/skills/skill-creator">skill creator skill</a> which you can possible use to start.</li><li>As with any of these instructions, you have to be clear about the versions your features are available in. Terraform search requires the user to have both terraform versions above 1.14.0 and using a provider version which has list resource support.</li><li>Compatibility requirements : I had mixed results with this parameter which I am keeping for now and will revisit later to refine further if needed.</li></ul><h3>Conclusion</h3><p>It was a fun experiment to see some of my existing instructions I had in my documents could be used to create a skill to import existing resources under Terraform management. The effort required in this case was minimal considering I had the instructions in various markdowns in my machine. tessl review helps to know what else could be optimized to efficiently manage what the model sees when it is made aware of the available skills. What&#39;s next ? I think the ephemerality and actions based approaches could use some nudge among practitioners.</p><blockquote><em>Note : As of today, my changes are on an </em><a href="https://github.com/hashicorp/agent-skills/pull/23"><em>active PR</em></a><em> being reviewed.</em></blockquote><p>References:</p><ul><li>Kiro CLI skill resources : <a href="https://kiro.dev/docs/cli/custom-agents/configuration-reference/#skill-resources">https://kiro.dev/docs/cli/custom-agents/configuration-reference/#skill-resources</a></li><li>Context engineering : <a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents">https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents</a></li></ul><p><em>Originally published at </em><a href="https://manuchandrasekhar.com/posts/2026/02-06-adding-tf-skills/"><em>https://manuchandrasekhar.com</em></a><em> on February 6, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fde7a164fcc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stategraph: Deploy on AWS with Terraform Part 1]]></title>
            <link>https://manuchandrasekhar.medium.com/stategraph-deploy-on-aws-with-terraform-part-1-324f8f0f8fe6?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/324f8f0f8fe6</guid>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[state-graph]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Mon, 02 Feb 2026 03:40:21 GMT</pubDate>
            <atom:updated>2026-02-04T14:33:56.667Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Crossposted from </em><a href="https://manuchandrasekhar.com/posts/2026/02-01-stategraph-aws-deployment/"><em>https://manuchandrasekhar.com/posts/2026/02-01-stategraph-aws-deployment/</em></a></blockquote><p>If you’re following the Infrastructure as Code space, Josh Pollara is a name you’ve likely encountered. While I haven’t personally tried <a href="https://terrateam.io/">terrateam</a>, I’ve been following what he and his co-founders have been building. One of the most common questions I get from customers using Terraform is around state management. Most AWS deployments default to S3 as a backend (with DynamoDB for locking in pre-1.10 Terraform versions). The <a href="https://stategraph.com/">idea of exploring another mechanism in the state management space intrigued me</a>, especially with promises around faster plans through their upcoming Velocity feature. The First Principles <a href="https://stategraph.com/first-principles">page</a> is worth reading, and this stood out:</p><blockquote><em>Infrastructure is a graph. Store it as a graph.</em></blockquote><p>I started with their backend implementation using the Docker Compose quickstart. I’ll save the nuances of the transactional nature of state changes and metadata tracking for a future post.</p><h3>Dev setup with Docker(Finch) compose</h3><p>The Docker Compose setup was straightforward for local development. Initially, I struggled with configuring this as a Terraform state backend. Stategraph implements the <a href="https://stategraph.com/docs/backend">HTTP backend protocol</a>, requiring an endpoint and authentication mechanism. My confusion was primarily because I skipped the Creating an API key section in the <a href="https://stategraph.com/docs/quickstart/state-backend#step-1-create-an-api-key">quickstart guide</a>.</p><p>The documentation could benefit from emphasizing the API key requirement earlier in the flow for users who might skip ahead (like me).</p><pre>terraform {<br>  backend &quot;http&quot; {<br>    address = &quot;http://myrest.api.com/foo&quot;<br>    username = &quot;session&quot;<br>    password = &quot;&lt;your-api-key&gt;&quot;<br>  }<br>}</pre><blockquote><em>Note that the user settings does give you an option to create a service account for CICD pipelines.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*NKCZ4Qtl103YFY7s.png" /></figure><p>For security, avoid hardcoding credentials in your backend configuration. Use environment variables instead. The environment variables TF_HTTP_USERNAME and TF_HTTP_PASSWORD are your best bet here.</p><pre>terraform {<br>  backend &quot;http&quot; {<br>    address = &quot;http://localhost:8080/api/v1/states/backend/&lt;group-id&gt;&quot;<br>  }<br>}</pre><h3>Understanding the group-id</h3><p>The group-id is a unique identifier that Stategraph assigns to organize and locate your Terraform state files. Think of it as a folder ID or address where your infrastructure state is stored. In HCP Terraform terms, it&#39;s similar to a workspace or project identifier. This is the first time I noticed the stategraph CLI.</p><p>For MacOs users, the installation is as simple as:</p><pre>brew tap stategraph/stategraph<br>brew install stategraph</pre><p>Generate the group-id using these commands (detailed in <a href="https://stategraph.com/docs/quickstart/state-backend#step-2-create-a-state">Create a state</a>):</p><pre># Get your tenant ID</pre><pre>stategraph user tenants list</pre><pre># Create a new state (returns group_id)<br>stategraph states create --tenant &lt;tenant_id&gt; --name &quot;stategraph-demo&quot;</pre><p>Response example:</p><pre>{<br>  &quot;id&quot;: &quot;...&quot;,<br>  &quot;name&quot;: &quot;stategraph-demo&quot;, <br>  &quot;group_id&quot;: &quot;550e8434-t59b-56d4-a716-329055440073&quot;,<br>  &quot;workspace&quot;: &quot;default&quot;<br>}</pre><h3>Initial Web Interface Impressions</h3><p>The Stategraph web interface impressed me with its clean design. Even with just two state files in my initial setup, the interface clearly prioritized giving visibility into individual resources within state files and across multiple states. The screenshots below show the different views available:</p><p><strong>State Overview:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*aNu7jA2qAXL48A_0.png" /></figure><p><strong>Control Plan Insights:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*SnpDn_FNKMUwszSe.png" /></figure><p><strong>State Metadata:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*BjSYzu0uz2H7Iqct.png" /></figure><h3>Deployment configuration using Terraform</h3><p>The local Docker Compose setup was just the beginning. I wanted to deploy Stategraph into a AWS account using ECS with an external PostgreSQL database on RDS. After several iterations and troubleshooting various configuration issues, I have a working deployment using <a href="https://github.com/stategraph/releases/releases/tag/0.1.16">Stategraph server version 0.1.16</a>. I do still need to tighten some screws around encryption.</p><p>The complete Terraform configuration I used is available at: <a href="https://github.com/quixoticmonk/stategraph-infra">Stategraph ECS Infrastructure</a></p><h3>Architecture Overview</h3><p>The infrastructure configuration creates a Stategraph environment with:</p><ul><li><strong>ECS EC2</strong>: Runs the Stategraph container (ghcr.io/stategraph/stategraph-server)</li><li><strong>CloudFront</strong>: CDN for HTTPS termination and global distribution</li><li><strong>Application Load Balancer</strong>: Routes traffic to ECS tasks</li><li><strong>RDS PostgreSQL 17</strong>: Database for state storage and transaction history</li><li><strong>VPC</strong>: Isolated network with public/private subnets</li><li><strong>Secrets Manager</strong>: Secure storage for database password and OAuth secrets</li></ul><h3>Prerequisites</h3><p>Before deploying, you’ll need:</p><ol><li><strong>AWS credentials</strong> configured (via environment variables, IAM roles, or AWS profiles)</li><li><strong>Terraform</strong> &gt;= 1.0</li><li><strong>Google OAuth Application</strong> — Set up at <a href="https://console.cloud.google.com/">Google Cloud Console</a></li></ol><ul><li>Create OAuth 2.0 Client ID for web application</li><li>Configure authorized redirect URIs</li></ul><h3>Key Configuration</h3><h3>Required Variables</h3><pre>variable &quot;google_oauth_client_id&quot; {<br>  description = &quot;Google OAuth Client ID&quot;<br>  type        = string<br>}<br><br>variable &quot;google_oauth_client_secret&quot; {<br>  description = &quot;Google OAuth Client Secret&quot;<br>  type        = string<br>  sensitive   = true<br>}</pre><h3>Container Configuration</h3><p>Stategraph runs on port 8180 internally with nginx as a reverse proxy on port 8080. Key environment variables include:</p><pre>environment = [<br>  {<br>    name  = &quot;STATEGRAPH_UI_BASE&quot;<br>    value = local.stategraph_url<br>  },<br>  {<br>    name  = &quot;STATEGRAPH_PORT&quot; <br>    value = &quot;8180&quot;<br>  },<br>  {<br>    name  = &quot;STATEGRAPH_OAUTH_TYPE&quot;<br>    value = &quot;oidc&quot;<br>  },<br>  {<br>    name  = &quot;STATEGRAPH_OAUTH_OIDC_ISSUER_URL&quot;<br>    value = &quot;https://accounts.google.com&quot;<br>  }<br>]<br><br>secrets = [<br>  {<br>    name      = &quot;DB_PASS&quot;<br>    valueFrom = aws_secretsmanager_secret.db_password.arn<br>  },<br>  {<br>    name      = &quot;STATEGRAPH_OAUTH_CLIENT_SECRET&quot;<br>    valueFrom = aws_secretsmanager_secret.google_client_secret.arn<br>  }<br>]</pre><blockquote><strong><em>Note:</em></strong><em> I used </em><em>oidc as the OAuth type instead of </em><em>google due to configuration issues with the latter. I have been lazy here not to go back and check what I missed.</em></blockquote><h3>Deployment</h3><ol><li><strong>Initialize and Deploy:</strong></li></ol><p>Follow the standard Terraform workflow:</p><pre>terraform init<br>   terraform plan<br>   terraform apply</pre><ol><li><strong>Configure OAuth:</strong></li></ol><p>After deployment, configure your Google OAuth application with the redirect URI:</p><pre>terraform output google_oauth_redirect_uri</pre><p>The callback URL will be in the format: <a href="https://abc.cloudfront.net/oauth2/oidc/callback">https://abc.cloudfront.net/oauth2/oidc/callback</a></p><ol><li><strong>Access Stategraph:</strong></li></ol><p>Retrieve the Stategraph URL from Terraform outputs:</p><pre># Get the HTTPS URL (via CloudFront)<br>   terraform output stategraph_url</pre><h3>Stategraph UI</h3><p>Once deployed, the initial setup flow includes several steps.</p><ul><li><strong>License Prompt</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*7MhqImBDPdtSnVC1.png" /></figure><ul><li><strong>Enter Existing License</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*yGweHEroiAAT9hFd.png" /></figure><ul><li><strong>User Information</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*0vjcV42xx_XTc08o.png" /></figure><ul><li><strong>Google Authentication</strong> (Note: I misconfigured STATEGRAPH_OAUTH_DISPLAY_NAME - it should be Google rather than the full message shown)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*svKgM9mtvgGZon9u.png" /></figure><ul><li><strong>Main Web Interface</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Y_gubmQvm8DqcPey.png" /></figure><h3>State Migration</h3><p>Obviously the next thing to do was migrate the state to Stategraph itself. For the Docker compose local development setup, I was copying and pasting without reading half of it. Now came the actual setup where I noticed the additional variables I need to keep in mind. You can generate an API KEY from the user settings and set these environment vars as you would need it for stategraph CLI command.</p><pre>export STATEGRAPH_API_BASE=&quot;&lt;stategragh_url&gt;&quot;<br>export STATEGRAPH_API_KEY=&quot;&lt;api_key&gt;&quot;</pre><p>Once done, retrieve the tenant id</p><pre>stategraph user tenants list</pre><p>And create the state container. This is where I think they should have a glossary of terms in reference to stategraph. We as a community have made some words difficult to use in many other contexts.</p><pre>stategraph states create --tenant &lt;tenant_id&gt; --name &quot;stategraph-ecs&quot;<br>{<br> &quot;created_at&quot;: &quot;2026-02-02T05:34:21Z&quot;,<br> &quot;group_id&quot;: &quot;&lt;group_id&gt;&quot;,<br> &quot;id&quot;: &quot;...&quot;,<br> &quot;name&quot;: &quot;stategraph-ecs&quot;,<br> &quot;workspace&quot;: &quot;default&quot;<br>}</pre><p>Update the Terraform block to use the same backend. I did backup the state before doing it though the configuration didn’t have a lot of components and I could have manually cleaned them up if I messed it up.</p><p>Run terraform init</p><pre>Initializing the backend...<br>Do you want to copy existing state to the new backend?<br>  Pre-existing state was found while migrating the previous &quot;local&quot; backend to the<br>  newly configured &quot;http&quot; backend. No existing state was found in the newly<br>  configured &quot;http&quot; backend. Do you want to copy this state to the new &quot;http&quot;<br>  backend? Enter &quot;yes&quot; to copy and &quot;no&quot; to start with an empty state.<br><br>Enter a value:</pre><p>Enter yes. Here goes nothing..</p><pre>Successfully configured the backend &quot;http&quot;! Terraform will automatically<br>use this backend unless the backend configuration changes.<br>Initializing provider plugins...<br>- Reusing previous version of hashicorp/random from the dependency lock file<br>- Reusing previous version of hashicorp/aws from the dependency lock file<br>- Using previously-installed hashicorp/aws v6.28.0<br>- Using previously-installed hashicorp/random v3.8.1<br><br>Terraform has been successfully initialized!<br>You may now begin working with Terraform. Try running &quot;terraform plan&quot; to see<br>any changes that are required for your infrastructure. All Terraform commands<br>should now work.<br>If you ever set or change modules or backend configuration for Terraform,<br>rerun this command to reinitialize your working directory. If you forget, other<br>commands will detect it and remind you to do so if necessary.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*GrDcJL7Cuqk0L924.png" /></figure><p>Run a plan to check everything is ok.</p><pre>random_password.db_password[0]: Refreshing state... [id=none]<br>random_id.secret_suffix: Refreshing state... [id=vKBxqA]<br>data.aws_availability_zones.available: Reading...<br>aws_secretsmanager_secret.db_password: Refreshing state... [id=arn:aws:secretsmanager:us-east-1:############:secret:stategraph-db-password-bca071a8-MgkbzS]<br>aws_ecs_cluster.main: Refreshing state... [id=arn:aws:ecs:us-east-1:############:cluster/stategraph]<br>data.aws_ami.ecs_optimized: Reading...<br>....<br>aws_cloudfront_distribution.stategraph: Refreshing state... [id=E2CDRVGI3JY6BT]<br>aws_db_instance.postgres: Refreshing state... [id=db-QRFNQQCUDBMW4HXCODVUHWKTXE]<br>aws_ecs_task_definition.stategraph: Refreshing state... [id=stategraph]<br>aws_ecs_service.stategraph: Refreshing state... [id=arn:aws:ecs:us-east-1:############:service/stategraph/stategraph]<br>No changes. Your infrastructure matches the configuration.<br>Terraform has compared your real infrastructure against your configuration and found no differences,<br>so no changes are needed.</pre><p>The Resource count on the pane looks off by 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*ZRb192NpYAut_6NV.png" /></figure><p>If you dig into the inspect state , you have the 48 resources listed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*gAsjIE0fGT0lpqrz.png" /></figure><h3>State Overview</h3><p>I still need to dive deep into what some of these data points mean, but they are there for you if you want them. The view is scoped to the state you were looking at; in my case the stategraph deployment itself. The page does give you quick jump off points to Search and Inventory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*PS5cElPwDyqwd651.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*nVOOq6l5_5wnhlJt.png" /></figure><p>The dependency blast radius and Top resource types !!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*sI71hCp5W95p8LqH.png" /></figure><blockquote><em>Now what are Orphaned candidates ? :thinkingface:</em></blockquote><h3>Inventory</h3><p>If you select one of the resource types from state overview, it takes you to the inventory of currently managed resources. This is sweet !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*pFuUJi4etlT-HTtF.png" /></figure><h3>Querying Resources</h3><p>The interface already gives you some sample queries and it worked out well with my stategraph infrastructure here. I am not going to draw parallels just yet, the query interface along with the examples were a nice a touch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*t_qxDzpOVxnhmB9S.png" /></figure><p>For your recurring queries :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Rt1m6-b-Sp9P1mLi.png" /></figure><p>I did feel like a kid during Christmas with a candy box all for himself ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/0*kncNMHSWj7Ciay_n.png" /></figure><h3>Monitoring and Troubleshooting</h3><p>Monitor your deployment through:</p><ul><li><strong>CloudWatch Logs</strong>: /ecs/stategraph log group</li><li><strong>ECS Service Events</strong>: Check for deployment issues</li><li><strong>Target Group Health</strong>: Monitor ALB target group status</li></ul><p>Common issues to watch for:</p><ul><li>Database connectivity (security groups, RDS availability)</li><li>OAuth configuration (redirect URIs, client secrets)</li><li>Load balancer health checks</li></ul><h3>Deployment Challenges</h3><p>I encountered couple of challenges during my ECS Terraform route:</p><ul><li><strong>Version Compatibility</strong>: Stategraph iterates releases frequently (almost daily). I struggled to get ALB health checks passing on versions before 0.1.15 due to ECS task failures during database migration tasks, even though database connectivity was confirmed.</li><li><strong>Compute Choice</strong>: I initially started with Fargate but switched to EC2 instances for some troubleshooting.</li></ul><h3>Conclusion</h3><p>Stategraph brings a fresh perspective to infrastructure state management that complement the existing ecosystem well. The visual interface and query capabilities will offer valuable insights that practitioners will appreciate, especially in organizations with a huge number of workloads targeting multiple platforms.</p><p>If you are looking to get started , the <a href="https://github.com/quixoticmonk/stategraph-infra">Terraform configuration here</a> should give you a fully stable infrastructure once you have a Google OAuth client ID. Or swap out the authentication mechanism based on your preference.</p><p>Here are the key resources I referenced during configuration:</p><ul><li><a href="https://stategraph.com/docs">Stategraph Documentation</a></li><li><a href="https://stategraph.com/docs/authentication/google-oauth">Stategraph OAuth Setup</a></li><li><a href="https://stategraph.com/docs/reference/environment-variables">Stategraph Environment Variables</a> — Comprehensive list of configuration options (I appreciate having all environment variables documented in one place!)</li><li><a href="https://console.cloud.google.com/">Google Cloud Console</a> — for OAuth setup</li></ul><p>There are so many components to this along with the orchestration side using Terrateam which I am excited to try. More of it in the next set of posts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=324f8f0f8fe6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terratags v0.8.0: Expanding Multi-Cloud Support]]></title>
            <link>https://manuchandrasekhar.medium.com/terratags-v0-8-0-expanding-multi-cloud-support-c8d7d45f9737?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8d7d45f9737</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[terratag]]></category>
            <category><![CDATA[tag]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 23:46:05 GMT</pubDate>
            <atom:updated>2026-02-01T23:46:05.656Z</atom:updated>
            <content:encoded><![CDATA[<p>The Terraform ecosystem continues to evolve with tools and mechanisms that make infrastructure modeling , provisioning and management more consistent and maintainable. I want to announce that <a href="https://github.com/terratags/terratags">Terratags</a> has just released version 0.8.0, bringing support for additional providers.</p><h3>What’s New with v0.7.0 and v0.8.0</h3><p>The latest releases continue to expand the support for additional providers:</p><h3>Google Cloud Beta Provider Support</h3><p>Terratags now supports the google-beta provider, which mirrors the implementation of the standard Google Cloud provider for labels. Similar to many providers in the HashiCorp registry, I got to know this via a contributor in the <a href="https://github.com/quixoticmonk/extract-provider-supported-actions/pull/1">Provider supported actions</a> repo.</p><p>The google-beta provider support includes:</p><ul><li>Full label management capabilities</li><li>Consistent behavior with the standard Google provider</li><li>Support for all taggable resources in the beta provider</li></ul><h3>Datadog Provider Integration</h3><p>The release also introduces support for the Datadog provider which I wasn’t aware of having a Terraform provider. If you know, you know :) . Datadog’s tagging system is unique in supporting both traditional key-value tags and their proprietary tag format.</p><p>Datadog provider support includes:</p><ul><li><strong>Default tags</strong> — Traditional key-value format:</li></ul><pre>default_tags {<br>  tags = {<br>    Environment = &quot;production&quot;<br>    Team        = &quot;platform&quot;<br>  }<br>}</pre><ul><li><strong>Tags array</strong> — Datadog’s colon-separated format:</li></ul><pre>tags = [<br>  &quot;Environment:production&quot;,<br>  &quot;Team:platform&quot;,<br>  &quot;Service:web-api&quot;<br>]</pre><h3>Alibaba cloud Support (v0.7.0)</h3><p>v0.7.0 introduced support for Alibaba Cloud . For someone who has never looked at the provider or resources, they mirror the AWS resources in many cases with similar looking names. Alicloud uses a tags map structure similar to AWS and other major cloud providers.</p><ul><li><strong>Tags map</strong> — Standard key-value format:</li></ul><pre>tags = {<br>  Environment = &quot;production&quot;<br>  Team        = &quot;platform&quot;<br>  Project     = &quot;web-api&quot;<br>}</pre><p>To use the new features, update to Terratags v0.8.0 and configure your providers as usual. Terratags will automatically detect and apply appropriate tagging strategies based on the providers in your Terraform configuration. For teams looking to automate Terratags in their CI/CD pipelines, the <a href="https://github.com/terratags/terratags-action">terratags-action</a> provides seamless GitHub Actions integration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8d7d45f9737" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kiro has Terraform skills]]></title>
            <link>https://manuchandrasekhar.medium.com/kiro-has-terraform-skills-6819c43e8dfb?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6819c43e8dfb</guid>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[skills]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 23:59:05 GMT</pubDate>
            <atom:updated>2026-01-27T23:59:05.672Z</atom:updated>
            <content:encoded><![CDATA[<p>Powers and now Skills. Kiro’s <a href="https://kiro.dev/changelog/cli/1-24/">1.24.0 version </a>just added support for <a href="https://agentskills.io/home">Skills</a>, the new open spec for giving agents new capabilities and expertise. In a way. Let me explain.</p><p>Naturally, I started using the kiro skills when the HashiCorp Sr PM for Agentic Workflows and a dear friend Gautam pinged asking if I tried the HashiCorp agent skills. Here is how I got along with it on kiro-cli which is my daily driver.</p><h3>What are HashiCorp Agent Skills?</h3><p>HashiCorp <a href="https://github.com/hashicorp/agent-skills">agent-skills</a> is a collection of specialized knowledge modules designed to enhance AI agents’ capabilities with HashiCorp products. Currently focused on Terraform, these skills can be integrated into most AI development tools.</p><p>The repository provides three main Terraform-focused plugins:</p><ul><li><strong>terraform-code-generation</strong>: Core HCL code generation following HashiCorp style conventions and Terraform test</li><li><strong>terraform-module-generation</strong>: Module refactoring and Terraform Stacks.</li><li><strong>terraform-provider-development</strong>: If you are a provider developer or contributor, you should be looking at this. If you remember my HashiConf talks on <a href="https://www.youtube.com/watch?v=97chxoMYMp0">Making AI work for you</a> where we discussed how kiro ( then Q) was assisting provider development teams with Terraform actions which was an unknown construct at that point.</li></ul><h3>So why should you care ?</h3><p>Skills, originally introduced by Anthropic is a new open spec for giving agents new capabilities and expertise. We can do with a lot more openness and consistency across these different ways of interacting with Generative AI agents. Sure, it is a markdown and you have the flexibility to add whatever details you need. But how much is always the question. And should all of it get loaded into context when the agent is starting up? If you use Terraform as a daily driver for your infrastructure provisioning, the HashiCorp suite of skills is something you should absolutely be considering with how it makes that context available for your agentic interactions.</p><h3>How do you use it ?</h3><p>Most of the skills, rules, instructions, MCP server are supposed to make our questions without a lot of context build that up as you interact with the coding agent of your choice. Much of what I am saying here is available in the public documentation; hence adding only the relevant ones for kiro-cli.</p><h4>Skills Installation</h4><p>If you have npx on your machine, it is as simple as:</p><pre>npx skills add hashicorp/agent-skills</pre><p>Or you can install a specific skill. Keep in mind that the installation step above does allow you to pick and choose the skills you want to install.</p><pre># Install a specific skill<br>npx skills add hashicorp/agent-skills/terraform/code-generation/skills/terraform-style-guide</pre><p>The skills terminal interface shows the source of the repository from which you are installing these skills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/0*DWG07lo1huz2NbD-.png" /></figure><p>Select the ones you are interested in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/0*iv1r3XIug5XwzBNv.png" /></figure><p>Now this is something I got confused about. I didn’t have 28 agents ( or did I ?)</p><pre>◇  Detected 28 agents<br>│<br>◆  Install to<br>│  ● All agents (Recommended) (Install to all 28 detected agents)<br>│  ○ Select specific agents<br>└</pre><p>These are not the custom kiro-cli agents, but the coding agents you use like Kiro, Kilo Code, Goose, Claude Code and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/0*NfyRC7oHA-MAAPfe.png" /></figure><p>Note the directory it is referencing here. This is the .kiro directory in your user space on a Mac.</p><pre>◆  Select agents to install skills to (space to toggle)<br>│  ◻ Antigravity<br>│  ◻ Claude Code<br>│  ◻ Clawdbot<br>│  ◻ Cline<br>...<br>│  ◻ Goose<br>│  ◻ Kilo Code<br>│  ◼ Kiro CLI (.kiro/skills)<br>│  ◻ MCPJam<br>│  ◻ Mux<br>...<br>│  ◻ Zencoder<br>│  ◻ Neovate</pre><p><strong>Scope:</strong> I would choose Global here rather than having to install it in every project under a .kiro directory. I used to do that for rules before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*TpaNmrSMewo-Vv2x.png" /></figure><p><strong>Installation method:</strong></p><pre>◆  Installation method<br>│  ● Symlink (Recommended) (Single source of truth, easy updates)<br>│  ○ Copy to all agents<br>└</pre><p>So what did we select until now?</p><pre>◇  Installation Summary ───────────────────╮<br>│                                          │<br>│  ~/.agents/skills/terraform-style-guide  │<br>│    symlink → Kiro CLI                    │<br>│    overwrites: Kiro CLI                  │<br>│                                          │<br>│  ~/.agents/skills/terraform-test         │<br>│    symlink → Kiro CLI                    │<br>│    overwrites: Kiro CLI                  │<br>│                                          │<br>│  ~/.agents/skills/refactor-module        │<br>│    symlink → Kiro CLI                    │<br>│    overwrites: Kiro CLI                  │<br>│                                          │<br>│  ~/.agents/skills/terraform-stacks       │<br>│    symlink → Kiro CLI                    │<br>│    overwrites: Kiro CLI                  │<br>│                                          │<br>├──────────────────────────────────────────╯<br>│<br>◆  Proceed with installation?<br>│  ● Yes / ○ No</pre><p>Proceed with installation.</p><pre>│<br>◇  Installed 4 skills to 1 agent ────────────╮<br>│                                            │<br>│  ✓ ~/.agents/skills/terraform-style-guide  │<br>│    symlink → Kiro CLI                      │<br>│  ✓ ~/.agents/skills/terraform-test         │<br>│    symlink → Kiro CLI                      │<br>│  ✓ ~/.agents/skills/refactor-module        │<br>│    symlink → Kiro CLI                      │<br>│  ✓ ~/.agents/skills/terraform-stacks       │<br>│    symlink → Kiro CLI                      │<br>│                                            │<br>├────────────────────────────────────────────╯│<br>└  Done!</pre><p>Are we done with the skills installation ? Not completely.</p><h4>Kiro skills resource</h4><p>Reference: <a href="https://kiro.dev/docs/cli/custom-agents/configuration-reference/#skill-resources">https://kiro.dev/docs/cli/custom-agents/configuration-reference/#skill-resources</a></p><p>kiro-cli (as of now) expects the skill to be referenced in a similar way as your rules or other markdowns. With a twist, the skill:// prefix makes kiro understand you are looking to load these dynamically when needed so that all of the text in all of the markdowns in there are not loaded always. If you are installing any skills for the first time, the npx install prompts you to install a find_skills skill too :)</p><p>In my Kiro CLI setup, I’ve configured a custom agent that combines whatever tools I use for Terraform development. kiro-cli lets you generate an agent allowing you to create the json file required for agent config in your .kiro/agents directory.</p><p>Here’s how it’s configured on my end.</p><pre>{<br>  &quot;name&quot;: &quot;iac&quot;,<br>  &quot;description&quot;: &quot;You are a specialist in infrastructure as code, especially with AWS.&quot;,<br>  &quot;prompt&quot;: &quot;You are a specialist in infrastructure as code (IaC), with deep expertise in AWS services and best practices. You help users design, implement, and manage cloud infrastructure using code-based approaches like Terraform, CloudFormation, CDK, and other IaC tools. You provide guidance on AWS architecture patterns, security best practices, cost optimization, and automation strategies. You can assist with writing, reviewing, and troubleshooting infrastructure code, as well as helping users understand AWS services and how to effectively use them in their infrastructure deployments.&quot;,<br>  &quot;mcpServers&quot;: {<br>    &quot;awslabs.aws-documentation-mcp-server&quot;: {<br>      &quot;command&quot;: &quot;uvx&quot;,<br>      &quot;args&quot;: [&quot;awslabs.aws-documentation-mcp-server@latest&quot;],<br>      &quot;env&quot;: {<br>        &quot;FASTMCP_LOG_LEVEL&quot;: &quot;ERROR&quot;,<br>        &quot;AWS_DOCUMENTATION_PARTITION&quot;: &quot;aws&quot;<br>      }<br>    },<br>    &quot;terraform&quot;: {<br>      &quot;command&quot;: &quot;finch&quot;,<br>      &quot;args&quot;: [&quot;run&quot;, &quot;-i&quot;, &quot;--rm&quot;, &quot;hashicorp/terraform-mcp-server&quot;],<br>      &quot;env&quot;: {<br>        &quot;FASTMCP_LOG_LEVEL&quot;: &quot;ERROR&quot;<br>      }<br>    }<br>  },<br>  &quot;tools&quot;: [&quot;*&quot;],<br>  &quot;toolAliases&quot;: {},<br>  &quot;allowedTools&quot;: [],<br>  &quot;resources&quot;: [&quot;skill://~/.kiro/skills/**/SKILL.md&quot;],<br>  &quot;hooks&quot;: {},<br>  &quot;toolsSettings&quot;: {},<br>  &quot;useLegacyMcpJson&quot;: false,<br>  &quot;model&quot;: null<br>}</pre><p>Note the [&quot;skill://~/.kiro/skills/**/SKILL.md&quot;], it is installed in my .kiro directory under user. You could modify it based on your installation.</p><h3>Skills in Action</h3><p>With the custom agent called iac, I can either invoke the agent directly or switch to that agent.</p><pre>kiro-cli --agent iac<br>✓ terraform loaded in 0.54 s<br>✓ Framelink MCP for Figma loaded in 1.49 s<br>⚠ 2 of 3 mcp servers initialized. Servers still loading:<br>- awslabs.aws-documentation-mcp-server<br>⠀⠀⠀⠀⠀⠀⠀<br>⠀⠀⠀⠀⠀⠀⠀     ⢀⣴⣶⣶⣦⡀⠀⠀⠀⢀⣴⣶⣦⣄⡀⠀⠀⢀⣴⣶⣶⣦⡀⠀⠀⢀⣴⣶⣶⣶⣶⣶⣶⣶⣶⣶⣦⣄⡀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣶⣶⣶⣶⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀<br>⠀⠀⠀⠀⠀⠀⠀    ⢰⣿⠋⠁⠈⠙⣿⡆⠀⢀⣾⡿⠁⠀⠈⢻⡆⢰⣿⠋⠁⠈⠙⣿⡆⢰⣿⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⣦⠀⠀⠀⠀⣴⡿⠟⠋⠁⠀⠀⠀⠈⠙⠻⢿⣦⠀⠀⠀⠀⠀⠀⠀<br>⠀⠀⠀⠀⠀⠀⠀    ⢸⣿⠀⠀⠀⠀⣿⣇⣴⡿⠋⠀⠀⠀⢀⣼⠇⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⢠⣤⣤⣤⣤⣄⠀⠀⠀⠀⣿⡆⠀⠀⣼⡟⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⢻⣧⠀⠀⠀⠀⠀<br>⠀⠀⠀⠀⠀⠀⠀    ⢸⣿⠀⠀⠀⠀⣿⡿⠋⠀⠀⠀⢀⣾⡿⠁⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⢸⣿⠉⠉⠉⣿⡇⠀⠀⠀⣿⡇⠀⣼⡟⠀⠀⠀⣰⡿⠟⠛⠻⢿⣆⠀⠀⠀⢻⣧⠀⠀⠀⠀<br>⠀⠀⠀⠀⠀⠀⠀    ⢸⣿⠀⠀⠀⠀⠙⠁⠀⠀⢀⣼⡟⠁⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⢸⣿⣶⣶⡶⠋⠀⠀⠀⠀⣿⠇⢰⣿⠀⠀⠀⢰⣿⠀⠀⠀⠀⠀⣿⡆⠀⠀⠀⣿⡆<br>⠀⠀⠀⠀⠀⠀⠀    ⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠹⣷⡀⠀⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣼⠟⠀⢸⣿⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⣿⡇⠀⠀⠀⣿⡇<br>⠀⠀⠀⠀⠀⠀⠀    ⢸⣿⠀⠀⠀⠀⠀⣠⡀⠀⠀⠹⣷⡄⠀⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⣤⣄⠀⠀⠀⠀⠹⣿⡅⠀⠀⠸⣿⠀⠀⠀⠸⣿⠀⠀⠀⠀⠀⣿⠇⠀⠀⠀⣿⠇<br>⠀⠀⠀⠀⠀⠀⠀    ⢸⣿⠀⠀⠀⠀⣾⡟⣷⡀⠀⠀⠘⣿⣆⠀⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⣿⡟⣷⡀⠀⠀⠀⠘⣿⣆⠀⠀⢻⣧⠀⠀⠀⠹⣷⣦⣤⣤⣾⠏⠀⠀⠀⣼⡟<br>⠀⠀⠀⠀⠀⠀⠀    ⢸⣿⠀⠀⠀⠀⣿⡇⠹⣷⡀⠀⠀⠈⢻⡇⠀⢸⣿⠀⠀⠀⠀⣿⡇⢸⣿⠀⠀⠀⠀⣿⡇⠹⣷⡀⠀⠀⠀⠈⢻⡇⠀⠀⢻⣧⠀⠀⠀⠀⠉⠉⠉⠀⠀⠀⠀⣼⡟<br>⠀⠀⠀⠀⠀⠀⠀    ⠸⣿⣄⡀⢀⣠⣿⠇⠀⠙⣷⡀⠀⢀⣼⠇⠀⠸⣿⣄⡀⢀⣠⣿⠇⠸⣿⣄⡀⢀⣠⣿⠇⠀⠙⣷⡀⠀⠀⢀⣼⠇⠀⠀⠀⠻⣷⣦⣄⡀⠀⠀⠀⢀⣠⣴⣾⠟<br>⠀⠀⠀⠀⠀⠀⠀    ⠀⠈⠻⠿⠿⠟⠁⠀⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠀⠈⠻⠿⠿⠟⠁⠀⠀⠀⠀⠀⠈⠙⠻⠿⠿⠿⠿⠟⠋⠁╭─────────────────────────────── Did you know? ────────────────────────────────╮<br>│                                                                              │<br>│     Enable workspace checkpoints to snapshot &amp; restore changes. Just run     │<br>│                 kiro-cli settings chat.enableCheckpoint true                 │<br>│                                                                              │<br>╰──────────────────────────────────────────────────────────────────────────────╯<br>Model: claude-sonnet-4 (/model to change)</pre><p>I haven’t yet found the command which told me what skills are available on load time. But introspect works in those cases.</p><pre>[iac] &gt; introspect are there any skills available for me to use ?<br>Introspecting to get you the right information (using tool: introspect) - Completed in 0.1s<br>&gt; Based on the context entries you provided, yes, you have several skills available:<br><br>Available Skills:<br>1. find-skills - Helps you discover and install additional agent skills when you ask questions like &quot;how do I do X&quot; or &quot;find a skill for X&quot;<br>2. refactor-module - Transforms monolithic Terraform configurations into reusable, maintainable modules following HashiCorp&#39;s best practices<br>3. terraform-stacks - Comprehensive guide for working with HashiCorp Terraform Stacks, including creating and managing .tfcomponent.hcl and .tfdeploy.hcl files<br>4. terraform-style-guide - Generates Terraform HCL code following HashiCorp&#39;s official style conventions and best practices<br>5. terraform-test - Comprehensive guide for writing and running Terraform tests, including creating .tftest.hcl files and test scenarios<br>These skills are stored in your ~/.kiro/skills/ directory and are designed to help with infrastructure as code tasks, particularly around Terraform development and best practices.<br>If you&#39;re looking for additional skills beyond these, you can use the find-skills skill to discover and install more capabilities based on your specific needs.<br> ▸ Time: 12s</pre><h3>Usage</h3><p>What do you do? You ask your question which you know will trigger the skill which can answer this. I haven’t figured out how the default kiro_default agent can get these without creating another custom agent. Maybe that is not possible since we need the agent configuration to include skill resources right now.</p><p>Let’s do this without calling our agent first time. For the eagle eyed and folks familiar with TF stacks, the tfstacks.hcl is being referenced which is still the old norm of creating stacks (Yes, I am on the TF MCP server 0.3.x version now)</p><pre>How do I create a Terraform stacks config for a VPC config from the private registry manu.example.com ?</pre><pre>&gt; I&#39;ll help you create a Terraform stacks configuration for a VPC from your private registry. Let me first get the latest Terraform provider version and then show you the minimal configuration.<br>Running tool get_latest_provider_version with the param (from mcp server: terraform)<br> ⋮  {<br> ⋮    &quot;namespace&quot;: &quot;hashicorp&quot;,<br> ⋮    &quot;name&quot;: &quot;aws&quot;<br> ⋮  }</pre><pre>Allow this action? Use &#39;t&#39; to trust (always allow) this tool for the session. [y/n/t]:</pre><pre>&gt; y</pre><pre> - Completed in 3.778s</pre><pre>&gt; Here&#39;s the minimal Terraform stacks configuration for a VPC from your private registry:</pre><pre>deployments.tfdeploy.hcl<br>hcl<br>deployment &quot;vpc&quot; {<br>  inputs = {<br>    regions = [&quot;us-east-1&quot;]<br>  }<br>}</pre><pre>vpc.tfstack.hcl<br>hcl<br>required_providers {<br>  aws = {<br>    source  = &quot;hashicorp/aws&quot;<br>    version = &quot;~&gt; 6.28.0&quot;<br>  }<br>}</pre><pre>variable &quot;regions&quot; {<br>  type = set(string)<br>}</pre><pre>component &quot;vpc&quot; {<br>  source = &quot;manu.example.com/your-namespace/vpc-module&quot;</pre><pre>  for_each = var.regions</pre><p>Invoke the agent kiro-cli --agent iac or /agent swap iac from within the CLI.</p><pre>How do I create a Terraform stacks config for a VPC config from the private registry manu.example.com ?</pre><pre>&gt; I&#39;ll help you create a Terraform Stacks configuration for a VPC from your private registry. Let me first check the terraform-stacks skill for the specific syntax.<br>Reading file: /Users/abc123/.kiro/skills/terraform-stacks/SKILL.md, all lines (using tool: read)<br>✓ Successfully read 14349 bytes from /Users/abc123/.kiro/skills/terraform-stacks/SKILL.md<br>- Completed in 0.0s</pre><pre>&gt; Based on the Terraform Stacks documentation, here&#39;s how to create a Stack configuration for a VPC from your private registry manu.example.com:</pre><pre>Component Configuration (components.tfcomponent.hcl):</pre><pre>hcl<br>component &quot;vpc&quot; {<br> source  = &quot;manu.example.com/vpc/aws&quot;<br> version = &quot;1.0.0&quot;</pre><pre> inputs = {<br>   cidr_block = var.vpc_cidr<br>   region     = var.aws_region<br> }</pre><pre> providers = {<br>   aws = provider.aws.this<br> }<br>}<br></pre><pre>Provider Configuration (providers.tfcomponent.hcl):</pre><pre>hcl<br>required_providers {<br> aws = {<br>   source  = &quot;hashicorp/aws&quot;<br>   version = &quot;~&gt; 5.7.0&quot;<br> }<br>}</pre><pre>provider &quot;aws&quot; &quot;this&quot; {<br> config {<br>   region = var.aws_region<br>   assume_role_with_web_identity {<br>     role_arn           = var.role_arn<br>     web_identity_token = var.identity_token<br>   }<br> }<br>}<br></pre><pre>Variables (variables.tfcomponent.hcl):</pre><pre>hcl<br>variable &quot;vpc_cidr&quot; {<br> type = string<br>}</pre><pre>...<br></pre><pre>Deployment (deployments.tfdeploy.hcl):</pre><pre>hcl<br>identity_token &quot;aws&quot; {<br> audience = [&quot;aws.workload.identity&quot;]<br>}</pre><pre>deployment &quot;production&quot; {<br> inputs = {<br>   vpc_cidr       = &quot;10.0.0.0/16&quot;<br>   aws_region     = &quot;us-west-1&quot;<br>   role_arn       = &quot;arn:aws:iam::123456789012:role/hcp-terraform-stacks&quot;<br>   identity_token = identity_token.aws.jwt<br> }<br>}<br></pre><pre>Key points for private registry sources:<br>- Use the full registry hostname in the source: manu.example.com/vpc/aws<br>- Include a version constraint<br>- Ensure you&#39;re authenticated to the private registry before running terraform stacks providers-lock<br>▸ Time: 19s</pre><h3>Bloopers</h3><h3>Without the agent invoked.</h3><pre>&gt; Do I have any skills available ?<br>&gt; Based on my review, you do not have any specific skills in the documents.</pre><h3>Looking Forward</h3><p>With only Terraform in the current skill list, take a look at the branches and you will see some of the groundwork done before and how it evolved into what is available as version 0.0.1.</p><p>I do have an open question to the skills developers or contributors. How do we make sure that the responses we get for a set of questions after making changes to the existing skills are not worsened after those changes ? How can we automatically validate these are goind in the wrong direction</p><p>The future of infrastructure development is looking increasingly collaborative — with AI agents that understand not just syntax, but the deeper patterns and practices that make infrastructure reliable, secure, and maintainable. Yes, I had the kiro write the above line ;)</p><p>Other notable skills for your Terraform/OpenTofu exploits:</p><ul><li><a href="https://github.com/antonbabenko/terraform-skill">Anton’s Terraform skills</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6819c43e8dfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CloudFormation Schema Version Tracker]]></title>
            <link>https://manuchandrasekhar.medium.com/aws-cloudformation-schema-version-tracker-6699d2ea082d?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6699d2ea082d</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloudformation]]></category>
            <category><![CDATA[schema]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Tue, 20 Jan 2026 16:36:50 GMT</pubDate>
            <atom:updated>2026-01-20T16:36:50.221Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been supporting the <a href="https://github.com/hashicorp/terraform-provider-awscc">Terraform AWSCC provider</a> from the last couple of years documenting examples, contributing with small code changes and triaging issues with the provider usage. Some of the key themes I have found are:</p><ul><li>A valid json schema doesn’t always mean they would translate well with the provider.</li><li>The provider has to take some specific steps to support some of the terraform workflows to ensure there is no drift when there isn’t one supposed to be.</li><li>AWS Schema updates aren’t versioned via some metadata available via public APIs, though the AWS console shows a specific LastUpdated date which might be on an internal API. ( wishlist item to have this be public similar to private extensions)</li></ul><blockquote>The existing AWS CloudFormation APIs (DescribeType and ListTypes) provide current schema versions and metadata like creation dates, but they don’t preserve historical versions or tell you when schemas actually changed. While the AWS console shows a last updated date for resource types, this information doesn’t appear to be available through the API. For example:</blockquote><pre>aws cloudformation describe-type --type RESOURCE --type-name &quot;AWS::S3::Bucket&quot;</pre><p>This returns the current schema and metadata like:</p><pre>{<br>    &quot;Arn&quot;: &quot;arn:aws:cloudformation:us-east-1::type/resource/AWS-S3-Bucket&quot;,<br>    &quot;TypeName&quot;: &quot;AWS::S3::Bucket&quot;,<br>    &quot;IsDefaultVersion&quot;: true,<br>    &quot;TimeCreated&quot;: &quot;2021-09-08T21:54:30.601000+00:00&quot;,<br>    &quot;Schema&quot;: &quot;{\&quot;typeName\&quot;: \&quot;AWS::S3::Bucket\&quot;, ...}&quot;<br>}</pre><p>But there’s no history of when it changed or what the previous versions looked like. This makes it impossible to correlate provider issues with specific schema updates especially for a partner like HashiCorp or Pulumi.</p><h3>A Possible Workaround</h3><p>This is purely personal pet project born out of a limitation as I couldn’t identify when CloudFormation schema versions actually changed, which made troubleshooting Terraform AWSCC provider issues a nightmare at times.</p><p>Introducing <a href="https://github.com/quixoticmonk/cfn-schema-versioning">cfn-schema-versioning</a>.</p><p>The intention of the repo are a few things :</p><ul><li><strong>Schema versioning</strong>: Preserve every version of each CloudFormation schema in git history</li><li><strong>Change traceability</strong>: Git diff to show exactly what changed between schema versions</li><li><strong>Timeline tracking</strong>: Approximate metadata tracking of when changes were detected. This is approximate as it really depends on when the schema was updated and published and we ran the GH workflows.</li><li><strong>AWS metadata</strong>: Captures additional AWS-provided metadata like creation time and deprecation status</li></ul><h3>How It Works</h3><p>The repository runs automated monitoring twice weekly via GitHub Actions:</p><ol><li><strong>Scheduled fetch</strong>: Runs on Mondays and Wednesdays at 6 AM UTC to fetch all AWS resource type schemas</li><li><strong>Schema comparison</strong>: Compares new schemas with existing files to detect actual changes</li><li><strong>Selective updates</strong>: Only commits and updates timestamps when schemas actually change</li><li><strong>Git history</strong>: Full change history preserved in git commits with timestamps</li></ol><p>The version_metadata.json file tracks key information for each resource type:</p><pre>{<br>  &quot;AWS::S3::Bucket&quot;: {<br>    &quot;deprecation_status&quot;: &quot;LIVE&quot;,<br>    &quot;first_seen&quot;: &quot;2026-01-19T02:02:20.407855&quot;,<br>    &quot;last_updated&quot;: &quot;2026-01-19T02:16:06.407687&quot;, <br>    &quot;time_created&quot;: &quot;2020-01-13T23:53:35.925000+00:00&quot;<br>  }<br>}</pre><p>When resource types are removed from AWS, they’re moved to removed_schemas.json to preserve the historical record. This approach selfishly helps me (and hopefully others) troubleshoot when CloudFormation schema changes break things in the Terraform AWSCC provider or when resource types get removed. Hopefully we get the updated date in the schemas with schema version references in the CloudControl API and this repo can be archived :)</p><p>I did mess up some of the metadata configurations when I first ran it and so some of the runs overwrote the last_updated for some schemas which in the current reference doesn’t make much difference from 17th to 19th. My plan is to review this further to change it to more accurate dates, even if it means I have to read through the different repos which are public or from the terraform-provider-awscc schemas list.</p><blockquote><strong>Note</strong>: This is a cross post from my blog <a href="https://manuchandrasekhar.com/">https://manuchandrasekhar.com/</a> .</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6699d2ea082d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform Module Guard: Multi-Engine Policy Validation for Module Sources]]></title>
            <link>https://manuchandrasekhar.medium.com/terraform-module-guard-multi-engine-policy-validation-for-module-sources-ec0ab70444ef?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec0ab70444ef</guid>
            <category><![CDATA[sentinel]]></category>
            <category><![CDATA[checkov]]></category>
            <category><![CDATA[open-policy-agent]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[policy-as-code]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 04:15:12 GMT</pubDate>
            <atom:updated>2025-11-13T04:15:12.554Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s November already !!! Are you in the naughty list or nice list ?</p><p>One of my wishlist items for HCP Terraform or Terraform enterprise has always been the ability to restrict what modules or providers can be used based on some list. Yes, if you have used GitHub actions the desire to have something similar comes from that interface of allowed actions. While that’s a wishlist item, I have had clients who had asked for mechanisms to do this using their existing policy as code frameworks. And when I say Policy as Code frameworks or tools, I mean some of these:</p><ul><li>checkov</li><li>opa</li><li>sentinel</li><li>Or a simple bash script</li></ul><p>Whether you’re using HCP Terraform with its enterprise features or the community edition with open-source tooling, you need consistent ways to validate module origins. This challenge led me to create <a href="https://github.com/quixoticmonk/terraform-module-guard">terraform-module-guard</a>, a collection of policies that validate Terraform module sources across multiple policy engines. The reason it exists is for purely selfish reasons as I often find myself trying to find that last time I used it which is in my filesystem somewhere.</p><h3>The Problem</h3><p>Let’s dive into the problem statement further.Terraform modules can be sourced from various locations:</p><ul><li>Public registries (registry.terraform.io)</li><li>Private registries</li><li>Git repositories</li><li>Local file paths or even HTTP URLs if I am not wrong</li></ul><p>Without proper controls, teams might inadvertently use modules from untrusted sources, potentially introducing security vulnerabilities or compliance violations. Different organizations use different policy engines based on their Terraform deployment model:</p><ul><li><strong>HCP Terraform users</strong> typically leverage Sentinel or OPA for policy enforcement</li><li><strong>Community edition users</strong> often rely on open-source tools like OPA, Checkov, or pre-commit hooks</li></ul><h3>My intention</h3><p>My intention here is purely as a frame of reference of what can be done to solve this problem across some common PaC frameworks.</p><ul><li>GitHub repo : <a href="https://github.com/quixoticmonk/terraform-module-guard">terraform-module-guard</a> provides identical policy logic implemented across different engines.</li></ul><p>Let’s start with the configuration elements. In the repo ,allowed-sources.yaml represents an example of what is allowed when considering the sources of the modules. I am using the inline versions of these for OPA and Sentinel. There might be ways to load the file into the evaluations. I might look into that later.</p><pre>allowed_sources:<br>  registry:<br>    - &quot;cloudposse/*&quot;<br>    - &quot;terraform-aws-modules/*&quot;<br>    - &quot;aws-ia/*&quot;<br>  git:<br>    - &quot;github.com/cloudposse/*&quot;<br>    - &quot;github.com/terraform-aws-modules/*&quot;<br>    - &quot;github.com/aws-ia/*&quot;</pre><p>This is merely an example of the keys and values I wanted to consider. You may have variations of this which you can absolutely add and update the policies with.</p><h3>Data Set</h3><p>The repository includes test files that demonstrate the policy validation across all engines. These examples were tested against:</p><ul><li><strong>Checkov</strong>: v3.2.458</li><li><strong>OPA</strong>: v1.9.0</li></ul><h3>✅ Good Module Sources</h3><p>Let’s define some passing examples. examples/pass/pass.tf:</p><pre>module &quot;vpc&quot; {<br>  source  = &quot;terraform-aws-modules/vpc/aws&quot;<br>  version = &quot;~&gt; 5.0&quot;<br>}<br><br>module &quot;label&quot; {<br>  source  = &quot;aws-ia/label/aws&quot;<br>  version = &quot;~&gt; 0.0.5&quot;<br>}<br>module &quot;cloudposse_module&quot; {<br>  source  = &quot;cloudposse/label/null&quot;<br>  version = &quot;~&gt; 0.25.0&quot;<br>}<br>module &quot;git_terraform_aws&quot; {<br>  source = &quot;git::ssh://git@github.com/terraform-aws-modules/terraform-aws-s3-bucket.git?ref=v4.0.0&quot;<br>}<br><br>module &quot;git_cloudposse&quot; {<br>  source = &quot;git::ssh://git@github.com/cloudposse/terraform-null-label.git?ref=0.25.0&quot;<br>}</pre><h3>❌ Bad Module Sources</h3><p>Similarly some failing examples. Yes, I do have a passing source mixed in to validate that it does get flagged as passed. (Blame the QA in me) These should be present in the repo as examples/fail/fail.tf:</p><pre>module &quot;quixoticmonk_glue_1&quot; {<br>  source = &quot;quixoticmonk/glue/aws&quot;<br>  version = &quot;~&gt; 0.0.3&quot;<br>}<br><br>module &quot;quixoticmonk_glue_2&quot; {<br>  source = &quot;quixoticmonk/glue/aws&quot;<br>  version = &quot;~&gt; 0.0.3&quot;<br>}<br>module &quot;docker_secret&quot; {<br>  source  = &quot;bendrucker/docker-secret/kubernetes&quot;<br>  version = &quot;1.0.0&quot;<br>  name      = &quot;my-docker-secret&quot;<br>  namespace = &quot;default&quot;<br>  registries = {<br>    &quot;docker.io&quot; = {<br>      username = &quot;user&quot;<br>      password = &quot;pass&quot;<br>      email    = &quot;user@example.com&quot;<br>    }<br>  }<br>}<br>module &quot;git_quixoticmonk_s3&quot; {<br>  source = &quot;git::ssh://git@github.com/quixoticmonk/terraform-aws-s3.git?ref=main&quot;<br>}<br># This should PASS - allowed source<br>module &quot;allowed_module&quot; {<br>  source  = &quot;terraform-aws-modules/vpc/aws&quot;<br>  version = &quot;~&gt; 5.0&quot;<br>}</pre><h3>1. Sentinel (HCP Terraform)</h3><p>For teams using HCP Terraform, you can use the Sentinel policy referenced <a href="https://github.com/quixoticmonk/terraform-module-guard/blob/main/sentinel/module-source-policy.sentinel">here</a>. Keep in mind that this uses a allowed_$$_sources input inside the policy itself. There may be a better way to define the list of sources and my sentinel kungfu is not that strong , yet. I should probably ask the sentinel team if there is a way to manage the sources.</p><p>You can either add this policy as part of a policyset via VCS connection or create a policy inline in the HCP Terraform UI and enforce it on a workspace.</p><p>For inline policies:</p><ul><li>Workspaces -&gt; Policies -&gt; Create a new policy -&gt; Select Sentinel and add the policy in the policy code (Sentinel) section</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*dSR4jH9WGOwDcXFm.png" /></figure><p>Create a Terraform workspace which has some of these modules being called in the configuration. Post plan, you should be able to see the details on Sentinel which should look something like below :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*5KIUE4-8M2UH288r.png" /></figure><p>This policy validates module sources during plan and apply operations, blocking runs that use unauthorized modules.</p><h3>2. Checkov</h3><p>If you have used Terraform and built a CICD pipeline for provisioning infrastructure using Terraform, you would have heard about Checkov which has become a standard for static analysis of the Terraform configuration. I do think it can get noisy without the severity classification. But I personally love the custom checks option which I keep using across the board for many situations where I need some new policies specific to my customer or something unique for my situation.</p><pre># Run specific module source validation<br>checkov -f main.tf --external-checks-dir checkov/ --check CKV_TF_MODULE_SOURCE</pre><p>For examples/pass/pass.tf:</p><pre>Passed checks: 5, Failed checks: 0, Skipped checks: 0<br><br>Check: CKV_TF_MODULE_SOURCE: &quot;Ensure module source is from allowed list&quot;<br>    PASSED for resource: vpc<br>    PASSED for resource: label<br>    PASSED for resource: cloudposse_module<br>    PASSED for resource: git_terraform_aws<br>    PASSED for resource: git_cloudposse</pre><p>Running against examples/fail/fail.tf. Yes, I did sneak in a passing source to verify if this actually does what I am expecting it to do.</p><pre>Passed checks: 1, Failed checks: 4, Skipped checks: 0<br><br>Check: CKV_TF_MODULE_SOURCE: &quot;Ensure module source is from allowed list&quot;<br>    PASSED for resource: allowed_module<br>    FAILED for resource: quixoticmonk_glue_1<br>    File: /fail.tf:4-7<br>        4 | module &quot;quixoticmonk_glue_1&quot; {<br>        5 |   source = &quot;quixoticmonk/glue/aws&quot;<br>        6 |   version = &quot;~&gt; 0.0.3&quot;<br>        7 | }<br>    FAILED for resource: quixoticmonk_glue_2<br>    File: /fail.tf:9-12<br>        9  | module &quot;quixoticmonk_glue_2&quot; {<br>        10 |   source = &quot;quixoticmonk/glue/aws&quot;<br>        11 |   version = &quot;~&gt; 0.0.3&quot;<br>        12 | }<br>    FAILED for resource: docker_secret<br>    File: /fail.tf:14-27<br>        14 | module &quot;docker_secret&quot; {<br>        15 |   source  = &quot;bendrucker/docker-secret/kubernetes&quot;<br>        16 |   version = &quot;1.0.0&quot;<br>    FAILED for resource: git_quixoticmonk_s3<br>    File: /fail.tf:30-32<br>        30 | module &quot;git_quixoticmonk_s3&quot; {<br>        31 |   source = &quot;git::ssh://git@github.com/quixoticmonk/terraform-aws-s3.git?ref=main&quot;<br>        32 | }</pre><h3>3. Open Policy Agent (OPA)</h3><p>If you prefer OPA , you could use the example policy from the opa directory against a Terraform plan json. The steps would look like below:</p><pre># Generate Terraform plan in JSON format<br>terraform init<br>terraform plan -out=tfplan.binary<br>terraform show -json tfplan.binary &gt; tfplan.json</pre><pre># Execute policy against Terraform plan JSON<br>opa exec --decision terraform/module_sources/deny --bundle opa/ tfplan.json</pre><pre># Fail on violations (recommended for CI/CD)<br>opa exec --decision terraform/module_sources/deny --bundle opa/ --fail-non-empty tfplan.json</pre><p>And what do we see…</p><p>For the pass scenarios present in examples/pass/opa/input.json</p><pre>{<br>  &quot;result&quot;: [<br>    {<br>      &quot;path&quot;: &quot;examples/pass/opa/input.json&quot;,<br>      &quot;result&quot;: [] # No violations.<br>    }<br>  ]<br>}<br>Exit code: 0</pre><p>Running against examples/fail/opa/input.json with --fail-non-empty:</p><pre>{<br>  &quot;result&quot;: [<br>    {<br>      &quot;path&quot;: &quot;examples/fail/opa/input.json&quot;,<br>      &quot;result&quot;: [<br>        &quot;Module &#39;docker_secret&#39; uses disallowed source: bendrucker/docker-secret/kubernetes&quot;,<br>        &quot;Module &#39;git_quixoticmonk_s3&#39; uses disallowed source: git::ssh://git@github.com/quixoticmonk/terraform-aws-s3.git?ref=main&quot;,<br>        &quot;Module &#39;quixoticmonk_glue_1&#39; uses disallowed source: quixoticmonk/glue/aws&quot;,<br>        &quot;Module &#39;quixoticmonk_glue_2&#39; uses disallowed source: quixoticmonk/glue/aws&quot;<br>      ]<br>    }<br>  ]<br>}<br>Exit code: 1</pre><p>The exit code on opa exec is really helpful when you are running this in a CICD pipeline if you are writing tests to validate your policies as well.</p><h3>4. Pre-commit Hooks</h3><p>You could technically include any of the above in the pre-commit step as a hook. I decided to create a bash script which effectively does some string manipulation to verify if the source is allowed. I had Amazon Q whip up this quick script to verify if the module source is in the allowed list or not.</p><pre>repos:<br>  - repo: local<br>    hooks:<br>      - id: validate-module-sources<br>        name: Validate module sources<br>        entry: ./pre-commit/validate-module-sources.sh<br>        language: script<br>        files: \.tf$</pre><p><strong>Test Results:</strong></p><p>Running against examples/pass/pass.tf:</p><pre>✅ No violations found - all module sources are allowed</pre><p>Running against examples/fail/fail.tf:</p><pre>ERROR: Disallowed module source in examples/fail/fail.tf: quixoticmonk/glue/aws<br>ERROR: Disallowed module source in examples/fail/fail.tf: quixoticmonk/glue/aws<br>ERROR: Disallowed module source in examples/fail/fail.tf: bendrucker/docker-secret/kubernetes<br>ERROR: Disallowed module source in examples/fail/fail.tf: git::ssh://git@github.com/quixoticmonk/terraform-aws-s3.git?ref=main</pre><h3>How can you get started ?</h3><p>The <a href="https://github.com/quixoticmonk/terraform-module-guard/">repository</a> includes examples to test and play around with:</p><ul><li>examples/pass/ - Valid module sources that should pass validation</li><li>examples/fail/ - Invalid sources that should trigger policy violations</li></ul><p>Whether you’re using HCP Terraform’s enterprise features or building with community tools, you should have the ability to implement consistent module source validation across your entire Terraform ecosystem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec0ab70444ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terratags v0.6.0: Remote Configuration and Google Cloud Support]]></title>
            <link>https://manuchandrasekhar.medium.com/terratags-v0-6-0-remote-configuration-and-google-cloud-support-858f68cef0e2?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/858f68cef0e2</guid>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[terratag]]></category>
            <category><![CDATA[tag]]></category>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Sat, 18 Oct 2025 14:38:06 GMT</pubDate>
            <atom:updated>2025-10-18T14:38:06.987Z</atom:updated>
            <content:encoded><![CDATA[<p>Terratags continues to evolve, and v0.6.0 brings two significant features: <strong>remote configuration support</strong> and <strong>Google Cloud Provider support</strong>. These additions make Terratags extend its reach beyond AWS and Azure to cover the major cloud providers.</p><h3>What’s New in v0.6.0</h3><h3>Remote Configuration Support</h3><p>One of the requested features was the ability to centralize configuration management. This allows team to avoid duplicating tag requirements across multiple repositories and maintain consistency across their infrastructure.</p><p>v0.6.0 introduces remote configuration support, allowing you to load your Terratags configuration from:</p><h4>HTTP/HTTPS URLs</h4><pre>terratags -config https://example.com/configs/terratags.yaml -dir ./infra</pre><h4>Git Repositories</h4><pre># HTTPS with branch/tag specification<br>terratags -config https://github.com/org/configs.git//terratags.yaml?ref=main -dir ./infra<br><br># SSH support for private repositories<br>terratags -config git@github.com:org/configs.git//path/to/config.yaml?ref=v1.0.0 -dir ./infra</pre><p>This is particularly powerful for organizations that want to:</p><ul><li>Version their tagging policies alongside their infrastructure code</li><li>Use different configurations for different environments (dev, staging, prod)</li><li>Maintain audit trails of configuration changes</li><li>Leverage Git’s branching and tagging for configuration management</li></ul><h4>Version Pinning and Environment-Specific Configs</h4><p>The Git integration supports referencing specific branches, tags, or commits:</p><pre># Production uses stable tagged version<br>terratags -config https://github.com/org/configs.git//prod-config.yaml?ref=v2.1.0<br># Development uses latest from main branch<br>terratags -config https://github.com/org/configs.git//dev-config.yaml?ref=main<br># Specific commit for reproducible builds<br>terratags -config https://github.com/org/configs.git//config.yaml?ref=abc123def</pre><h3>Google Cloud Provider Support</h3><p>The second major addition is full support for Google Cloud Platform. GCP uses ‘labels’ instead of ‘tags’ for resource metadata.</p><h4>Basic GCP Label Validation</h4><pre>resource &quot;google_compute_instance&quot; &quot;web_server&quot; {<br>  name         = &quot;web-server-01&quot;<br>  machine_type = &quot;e2-medium&quot;<br>  zone         = &quot;us-central1-a&quot;<br>labels = {<br>    environment = &quot;production&quot;<br>    project     = &quot;web-app&quot;<br>    owner       = &quot;devops@example.com&quot;<br>    name        = &quot;web-server-01&quot;<br>  }<br>}</pre><h4>Google Provider default_labels Support</h4><p>Just like AWS and Azapi provider’s default_tags , Google provider&#39;s default_labels are fully supported:</p><pre>provider &quot;google&quot; {<br>  project = &quot;my-project-id&quot;<br>  region  = &quot;us-central1&quot;<br>default_labels = {<br>    environment = &quot;production&quot;<br>    owner       = &quot;team-platform&quot;<br>    managed_by  = &quot;terraform&quot;<br>  }<br>}<br>resource &quot;google_storage_bucket&quot; &quot;data_bucket&quot; {<br>  name     = &quot;company-data-bucket&quot;<br>  location = &quot;US&quot;<br>  # Only need to specify labels not covered by default_labels<br>  labels = {<br>    name    = &quot;data-bucket&quot;<br>    project = &quot;analytics&quot;<br>  }<br>}</pre><p>In this example, the bucket will have all required labels: name and project from the resource-level labels, and environment, owner, and managed_by from the provider&#39;s default_labels.</p><h3>Multi-Cloud Tagging Consistency</h3><p>With v0.6.0, Terratags now supports all three major cloud providers with their respective tagging mechanisms:</p><ul><li><strong>AWS</strong>: tags with default_tags support</li><li><strong>Azure</strong>: tags with azapi default_tags support</li><li><strong>Google Cloud</strong>: labels with default_labels support</li></ul><p>This means you can maintain consistent tagging policies across your entire multi-cloud infrastructure using a single tool and configuration format.</p><h3>Validation in CI/CD</h3><pre># GitHub Actions example<br>- name: Validate AWS Resources<br>  run: terratags -config https://example.com/aws-tags.yaml -dir ./aws-infra<br>- name: Validate GCP Resources  <br>  run: terratags -config https://example.com/gcp-labels.yaml -dir ./gcp-infra<br>- name: Validate Azure Resources<br>  run: terratags -config https://example.com/azure-tags.yaml -dir ./azure-infra</pre><h3>Pattern Validation</h3><p>The advanced pattern validation introduced in earlier versions works consistently across all providers:</p><pre># Works for AWS tags, Azure tags, and GCP labels<br>required_tags:<br>  environment:<br>    pattern: &quot;^(dev|test|staging|prod)$&quot;<br>owner:<br>    pattern: &quot;^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$&quot;<br>  cost_center:<br>    pattern: &quot;^CC-[0-9]{4}$&quot;</pre><h3>Getting Started with v0.6.0</h3><h3>Installation</h3><pre># Using Homebrew (recommended)<br>brew install terratags/tap/terratags<br># Or download from GitHub releases<br># https://github.com/terratags/terratags/releases/tag/v0.6.</pre><h3>Quick Start with Remote Config</h3><ol><li><strong>Set up a remote configuration</strong>:</li></ol><pre># https://example.com/terratags.yaml<br>required_tags:<br>  environment:<br>    pattern: &quot;^(dev|test|staging|prod)$&quot;<br>  owner:<br>    pattern: &quot;^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$&quot;<br>  project: {}<br>  name: {}</pre><ol><li><strong>Run validation</strong>:</li></ol><pre>terratags -config https://example.com/terratags.yaml -dir ./infra -report report.html</pre><ol><li><strong>Set up pre-commit hooks</strong>:</li></ol><pre>repos:<br>  - repo: https://github.com/terratags/terratags<br>    rev: v0.6.0<br>    hooks:<br>      - id: terratags<br>        args: [--config=https://example.com/terratags.yaml]</pre><h3>Looking Ahead</h3><p>There are a few items in the report generation which I want to look to implement, without breaking existing structure and including all the metadata.</p><h3>Resources</h3><ul><li><strong>GitHub Repository</strong>: <a href="https://github.com/terratags/terratags">https://github.com/terratags/terratags</a></li><li><strong>Documentation</strong>: <a href="https://terratags.github.io/terratags/">https://terratags.github.io/terratags/</a></li><li><strong>Remote Config Examples</strong>: <a href="https://terratags.github.io/terratags/examples/remote_config/">https://terratags.github.io/terratags/examples/remote_config/</a></li><li><strong>Release Notes</strong>: <a href="https://github.com/terratags/terratags/releases/tag/v0.6.0">https://github.com/terratags/terratags/releases/tag/v0.6.0</a></li></ul><p>If you’re using Terratags and have been waiting for centralized configuration management, v0.6.0 is definitely worth the upgrade. As always, I’d love to hear about your experience and any feedback you have!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=858f68cef0e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring terraform provider capabilities with schema analysis]]></title>
            <link>https://manuchandrasekhar.medium.com/exploring-terraform-provider-capabilities-with-schema-analysis-362f0d0e3ce5?source=rss-53b65d46bb8e------2</link>
            <guid isPermaLink="false">https://medium.com/p/362f0d0e3ce5</guid>
            <category><![CDATA[schema]]></category>
            <category><![CDATA[provider]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Manu Chandrasekhar]]></dc:creator>
            <pubDate>Thu, 09 Oct 2025 18:00:22 GMT</pubDate>
            <atom:updated>2025-10-12T17:01:16.641Z</atom:updated>
            <content:encoded><![CDATA[<p>Terraform has become the de facto name when it comes to tools which help you model infrastructure in a declarative language, the idea of which we call as Infrastructure as Code. At a very high level, Terraform is a Go binary which knows how to do some things well. And providers are that much needed context which terraform needs to work with a platform. The platform can be a cloud service provider or an artifactory platform like jFrog and so on. Most developers only scratch the surface of what Terraform providers offer. While everyone knows about basic resources and datasources available within a provider, anything beyond that is still not easily discovered ( unless the documentation surfaces them up well).</p><p>You’re deploying infrastructure with Terraform and need to invalidate a CloudFront cache after your S3 bucket updates (Like with this blog). You’ve heard Terraform has a new concept called “actions” for this, but how do you discover what’s available? In this post, we’ll explore how to use the terraform providers subcommand to identify some of the core capabilities which might exist with the provider you normally interact with.</p><p>Note: With the availability of Terraform MCP servers, these might be easier than how it was earlier.</p><h3>Pre-requisites</h3><p>The sections below lists commands which can provide you more details around the core capabilities( for lack of better terms) that exist with aws provider. You may use the provider that you use in your daily life.</p><ul><li>jq for maneuvering around the json schema file</li><li>terraform binary :1.14.0-beta versions to gather some of the attributes</li><li>The latest version of your provider.</li></ul><h3>providers schema command</h3><p>If you have ever run the terraform providers command, you will see the list of options available; out of which we are going to dive into the schema subcommand. Terraform&#39;s providers schema command exposes every capability your provider supports in a structured JSON format.</p><pre>❯ terraform providers --help<br>Options:<br>  -test-directory=path  Set the Terraform test directory, defaults to &quot;tests&quot;.<br>Subcommands:<br>    lock      Write out dependency locks for the configured providers<br>    mirror    Save local copies of all required provider plugins<br>    schema    Show schemas for the providers used in the configuration</pre><p>Warning: If you run the command terraform provider schema -json on your terminal expect a ball of text to fill your terminal screen.</p><h3>Quick Setup</h3><p>Let’s start with a minimal Terraform configuration to explore the AWS &amp; AWSCC provider:</p><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source = &quot;hashicorp/aws&quot;<br>    }<br>    awscc = {<br>      source = &quot;hashicorp/awscc&quot;<br>    }<br>  }<br>}<br><br>provider &quot;aws&quot; {<br>  region = &quot;us-west-2&quot;<br>}<br>provider &quot;awscc&quot; {<br>  region = &quot;us-west-2&quot;<br>}</pre><p>After running terraform init, we can extract the complete provider schema using the below command. I am going to pipe the results out to a json file so that I can perform my analysis on the available file.</p><pre>terraform init<br>terraform providers schema -json &gt; aws_schema.json</pre><h3>Provider Capability Categories</h3><p>First, let’s see what capability types are available. Over the course of time, Terraform introduced many schema capabilities/types that providers adopted. To get the list of capabilities, all we need to do is find the keys inside provider_schemas.</p><p>At the time of writing this, the AWS provider supports 8 distinct capability types:</p><pre>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;] | keys&#39; aws_schema.json</pre><p>What about the AWSCC provider ? It supports 5 at the moment.</p><pre>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/awscc&quot;] | keys&#39; aws_schema.json<br>[<br>  &quot;data_source_schemas&quot;,<br>  &quot;list_resource_schemas&quot;,<br>  &quot;provider&quot;,<br>  &quot;resource_identity_schemas&quot;,<br>  &quot;resource_schemas&quot;<br>]</pre><h3>Let’s get some numbers</h3><p>Now let’s find how many resources exist in each of the provider.</p><pre>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].resource_schemas | keys | length&#39; aws_schema.json<br>1544<br><br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/awscc&quot;].resource_schemas | keys | length&#39; aws_schema.json<br>1214</pre><p>There are 1544 &amp; 1214 resources in the AWS and AWSCC providers respectively at this point. The key thing to note here is that you can replace the capability type you want to review and gather the specific detaills of those types.</p><pre># Count data sources  <br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].data_source_schemas | keys | length&#39; aws_schema.json<br><br># Count functions<br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].functions | keys | length&#39; aws_schema.json<br><br># Count action schemas<br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].action_schemas | keys | length&#39; aws_schema.json<br><br># Count ephemeral resources<br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].ephemeral_resource_schemas | keys | length&#39; aws_schema.json<br><br># Count resource identity schemas<br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].resource_identity_schemas | keys | length&#39; aws_schema.json<br><br># Count list resources<br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].list_resource_schemas | keys | length&#39; aws_schema.json</pre><p>For ease of associating them, I have just mapped them to the capability type. You can probably do this with jq as well.</p><pre>[<br>  &quot;action_schemas&quot;,           // 8 actions<br>  &quot;data_source_schemas&quot;,      // 622 data sources  <br>  &quot;ephemeral_resource_schemas&quot;, // 7 ephemeral resources<br>  &quot;functions&quot;,                // 3 functions<br>  &quot;list_resource_schemas&quot;,    // 4 list resources<br>  &quot;provider&quot;,                 // Provider configuration<br>  &quot;resource_identity_schemas&quot;, // 212 identity schemas<br>  &quot;resource_schemas&quot;          // 1,544 resources<br>]</pre><h3>Dive deep into a type</h3><p>So all these commands are great at presenting you the details in a provider schema. Why do I need it again ? HashiConf ’25 introduced two core capabilities with provider support.</p><ul><li>Terraform search : Query a list of resources of certain type(s) and provide a means to import them to your state file , if you so desire.</li><li>Terraform actions : A HCL native way of managing pre/post- operations on resources during the lifecycle management of resources. In short, the idea is to give an alternative to some of the bespoke scripts and local-exec provisioners running in the modules you know of. This blog itself uses a cache invalidation step with CloudFront once the deployment is complete.</li></ul><p>One of my biggest pain points with the provider documentation currently is with how these types are listed. Or rather not listed. AWS provider groups capability types by the resource types like S3 bucket and so there is no easy way to identify the number of actions or list resources supported across the provider. Once I know that a resource type exists, I can search for that one and identify the attributes to use.</p><p>Can we get that information from the providers schema? Yes, you can. Let&#39;s start with the action schema.</p><blockquote><strong><em>Question:</em></strong><em> What action resources are supported in AWS provider ?</em></blockquote><pre>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].action_schemas | keys&#39; aws_schema.json<br><br>[<br>  &quot;aws_cloudfront_create_invalidation&quot;,<br>  &quot;aws_codebuild_start_build&quot;, <br>  &quot;aws_ec2_stop_instance&quot;,<br>  &quot;aws_events_put_events&quot;,<br>  &quot;aws_lambda_invoke&quot;,<br>  &quot;aws_ses_send_email&quot;,<br>  &quot;aws_sfn_start_execution&quot;,<br>  &quot;aws_sns_publish&quot;<br>]</pre><blockquote><strong><em>Question:</em></strong><em> What about list resources ?</em></blockquote><pre>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].list_resource_schemas | keys&#39; aws_schema.json<br>[<br>  &quot;aws_batch_job_queue&quot;,<br>  &quot;aws_cloudwatch_log_group&quot;,<br>  &quot;aws_iam_role&quot;,<br>  &quot;aws_instance&quot;<br>]</pre><p>So what if I want to know the supported actions or list resources across other providers ? You can easily change the provider configuration in the providers.tf file I had above to include your provider details and run the same commands. OR, you can take a look at my GitHub repo <a href="https://github.com/quixoticmonk/extract-provider-supported-actions">here</a>. Yes, it is named provider actions before I realized I could do this for all types ( actions, list, functions, ephemeral and so on)</p><p>To drive the point home:</p><h3>Discover available provider functions:</h3><pre># List all functions<br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].functions | keys&#39; aws_schema.json<br><br>[<br>  &quot;arn_build&quot;,      // Construct ARNs programmatically<br>  &quot;arn_parse&quot;,      // Parse ARN components<br>  &quot;trim_iam_role_path&quot;  // Clean IAM role paths<br>]</pre><h3>Ephemeral Resources: Temporary Data</h3><p>Discover ephemeral resources:</p><pre># List all ephemeral resources<br>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].ephemeral_resource_schemas | keys&#39; aws_schema.json<br><br>[<br>  &quot;aws_cognito_identity_openid_token_for_developer_identity&quot;,<br>  &quot;aws_eks_cluster_auth&quot;,<br>  &quot;aws_kms_secrets&quot;, <br>  &quot;aws_lambda_invocation&quot;,<br>  &quot;aws_secretsmanager_random_password&quot;,<br>  &quot;aws_secretsmanager_secret_version&quot;,<br>  &quot;aws_ssm_parameter&quot;<br>]</pre><h3>Review attributes in a specific resource</h3><p>It doesn’t stop there. You have the ability to dive deeper into a resource in a provider and understand the list of attributes expected and if needed pull the required attributes alone. How will you do it ?</p><p>Let’s check how many attributes are marked as required on aws_s3_bucket resource.</p><pre>❯ jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/aws&quot;].resource_schemas.aws_s3_bucket.block.attributes | to_entries | map(select(.value.required == true)) | map(.key)&#39; aws_schema.json<br><br>[]. # None</pre><h3>Conclusion</h3><p>The next time you look at a provider and want to identify what it offers, I hope you will give this a try.</p><blockquote><strong><em>Note:</em></strong><em> The Terraform MCP server is adding the actions and list resources discovery into the latest iteration from the looks of it. Hopefully that makes this simpler if you use a Gen AI agent in your work.</em></blockquote><p>To explore your provider schemas; replace the with yours once the provider block is updated.</p><pre># Initialize your Terraform configuration<br>terraform init<br><br># Extract complete schema<br>terraform providers schema -json ❯ provider_schema.json<br># Explore !!!<br>jq &#39;.provider_schemas | keys&#39; provider_schema.json<br>jq &#39;.provider_schemas[&quot;registry.terraform.io/hashicorp/&lt;provider_name&gt;&quot;] | keys&#39; provider_schema.json</pre><ul><li>GitHub repo with List/Actions : <a href="https://github.com/quixoticmonk/extract-provider-supported-actions">Extract actions/list</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=362f0d0e3ce5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>