Add support for OpenTofu #7861
                  
                    
                      appleoddity
                    
                  
                
                  started this conversation in
                Ideas
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As of right now, OpenTofu is incompatible with SAM CLI. I spent quite a bit of time trying to shoehorn it in. It's possible to create a symlink from terraform -> tofu and get SAM CLI to generate plan data. However, the SAM CLI source code hardcodes the terraform registry so that it ignores resources created with modules from the opentofu registry. This includes
nullresources.Because the serverless
terraform-aws-modulescreates a number of additional resources besides just the one that is defined in the IAC, it's not possible to control which module source it uses, specifically for thesam_metadatanullresource.This terraform/opentofu code generates a number of additional resources, including the
sam_metadataresource:Even though I specify the terraform registry, the sub-resources this module creates from
aws,external,localandnulldo not honor that. So, we get output like this in the plan JSON:Notice the
provider_name.At a minimum, the hardcoding of the terraform registry causes inflexibility and incompatibilities with using OpenTofu.
I propose you add an OpenTofu compatible hook.
Beta Was this translation helpful? Give feedback.
All reactions