dtan4 / terraforming

Export existing AWS resources to Terraform style (tf, tfstate) / No longer actively maintained
http://terraforming.dtan4.net/
MIT License
4.29k stars 659 forks source link

Terraforming r53r wildcard 052 resource title #347

Closed furhouse closed 7 years ago

furhouse commented 7 years ago

Hi,

I've just ran terraforming r53r with version 0.13.2, and it exported a wildcard domain as

resource "aws_route53_record" "-052-example-com-CNAME" {       
    zone_id = "XYZ"                             
    name    = "*.example.com"                                  
    type    = "CNAME"                                      
    records = ["example.com."]                                 
    ttl     = "1800"                                       

}

This way, terraform plan throws up an error:

$ terraform plan

1 error(s) occurred:

* aws_route53_record.-052-example-com-CNAME: -052-example-com-CNAME: resource name can only contain letters, numbers, dashes, and underscores.

Digging through the issues, I found https://github.com/dtan4/terraforming/pull/139, but it seems like the issue has been re-introduced.

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.12
  - RUBY VERSION: 2.3.4 (2017-03-30 patchlevel 301) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/user/.rvm/gems/ruby-2.3.4
  - USER INSTALLATION DIRECTORY: /home/user/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /home/user/.rvm/rubies/ruby-2.3.4/bin/ruby
  - EXECUTABLE DIRECTORY: /home/user/.rvm/gems/ruby-2.3.4/bin
  - SPEC CACHE DIRECTORY: /home/user/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /home/user/.rvm/rubies/ruby-2.3.4/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/user/.rvm/gems/ruby-2.3.4
     - /home/user/.rvm/gems/ruby-2.3.4@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-document"
     - "update" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/user/.rvm/gems/ruby-2.3.4/bin
     - /home/user/.rvm/gems/ruby-2.3.4@global/bin
     - /home/user/.rvm/rubies/ruby-2.3.4/bin
     - /usr/local/bin
     - /usr/local/sbin
     - /usr/bin
     - /usr/lib/jvm/default/bin
     - /usr/bin/site_perl
     - /usr/bin/vendor_perl
     - /usr/bin/core_perl
     - /home/user/.rvm/bin
     - /home/user/bin
     - /home/user/.rvm/bin
$ gem list terraforming
*** LOCAL GEMS ***
terraforming (0.13.2)