Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dns domain with the same name as a template causes highlander to create a parameter from an output #111

Open
Guslington opened this issue May 29, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@Guslington
Copy link
Member

Issue

If my domain name is prefixed with the same same as one of my components, that value is turned into a Fn::GetAtt from the output of the component.

DnsDomain:
          Fn::GetAtt:
          - sftp
          - Outputs.mydomain

My work around for the moment is to apply that parameter at runtime. Do we need to allow for the functionality if we have the cfout() function to generate the Fn::GetAtt?

Example

CfhighlanderTemplate do
  Name 'my-sftp'
  Description "my-sftp"

  Component name: 'vpc', template: 'vpc' do
    parameter name: 'DnsDomain', value: "sftp.mydomain.com"
    parameter name: 'NetworkPrefix', value: '10'
    parameter name: 'StackMask', value: '16'
  end

  Component name: 's3', template: 's3'

  Component name: 'sftp', template: 'sftpDnsDomain' do
    parameter name: 'VpcId', value: cfout('vpc.VPCId')
    parameter name: 'SubnetIds', value: cfout('vpc.ComputeSubnets')
    parameter name: 'DnsDomain', value: "sftp.mydomain.com"
    parameter name: 'VPCCidr', value: cfout('vpc.VPCCidr')
  end

  Component name: 'loadbalancer', template: '[email protected]' do
    parameter name: 'VpcId', value: cfout('vpc.VPCId')
    parameter name: 'SubnetIds', value: cfout('vpc.PublicSubnets')
    parameter name: 'DnsDomain', value: "sftp.mydomain.com"
    parameter name: 'VpcEndpointIPs', value: cfout('sftp.VpcEndpointIPs')
  end

end

Exception

Validate template /Users/gus/src/ss/ss-sftp-cloudformation/out/yaml/ss-sftp.compiled.yaml locally
Traceback (most recent call last):
	21: from /Users/gus/.rbenv/versions/2.5.3/bin/cfcompile:23:in `<main>'
	20: from /Users/gus/.rbenv/versions/2.5.3/bin/cfcompile:23:in `load'
	19: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/bin/cfcompile:4:in `<top (required)>'
	18: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/bin/cfcompile:4:in `require_relative'
	17: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/bin/cfhighlander.rb:301:in `<top (required)>'
	16: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	15: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	14: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	13: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	12: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/bin/cfhighlander.rb:113:in `cfcompile'
	11: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/lib/cfhighlander.validator.rb:17:in `validate'
	10: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/lib/cfhighlander.validator.rb:17:in `each'
	 9: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/lib/cfhighlander.validator.rb:29:in `block in validate'
	 8: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/cfhighlander-0.9.0/lib/cfhighlander.validator.rb:40:in `validate_local'
	 7: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-cloudformation-1.19.0/lib/aws-sdk-cloudformation/client.rb:4203:in `validate_template'
	 6: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.51.0/lib/seahorse/client/request.rb:70:in `send_request'
	 5: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.51.0/lib/seahorse/client/plugins/response_target.rb:23:in `call'
	 4: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.51.0/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
	 3: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.51.0/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
	 2: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.51.0/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
	 1: from /Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.51.0/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
/Users/gus/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/aws-sdk-core-3.51.0/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': Circular dependency between resources: [loadbalancer, vpc, sftp] (Aws::CloudFormation::Errors::ValidationError)
@Guslington Guslington added the bug Something isn't working label May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant