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

Reference is missing when reading the yaml #290

Open
debankur1 opened this issue Jul 22, 2020 · 2 comments
Open

Reference is missing when reading the yaml #290

debankur1 opened this issue Jul 22, 2020 · 2 comments

Comments

@debankur1
Copy link

SournceYaml : = 'AWSTemplateFormatVersion: 2010-09-09
Resources:
MyTopic:
Properties:
TopicName: my-topic-1536878058
Type: AWS::SNS::Topic
MyTopicSubscription:
Properties:
Endpoint: [email protected]
Protocol: email
TopicArn:
Ref: MyTopic
Type: AWS::SNS::Subscription'

cfn_template,err := goformation.ParseYAML([]byte(SournceYaml))
strYaml,_ := cfn_template.YAML()
fmt.Println(string(strYaml))

Output:

AWSTemplateFormatVersion: 2010-09-09
Resources:
MyTopic:
Properties:
TopicName: my-topic-1536878058
Type: AWS::SNS::Topic
MyTopicSubscription:
Properties:
Endpoint: [email protected]
Protocol: email
Type: AWS::SNS::Subscription

TopicArn:
Ref: MyTopic

is missing goformation is not able to set the reference.

The same goes for properties when setting a value in properties and referring the same it is not working.
these are valid when we want to set a VPCid for a stack and need to refer the same from the resources.

@debankur1
Copy link
Author

AWSTemplateFormatVersion: 2010-09-09
Parameters:
VpcId:
Description: VPC Id
Type: String
Default:
Ref: VpcId
Resources:
sg1:
Properties:
GroupDescription: allow access from vpc nat gateways
GroupName: qbse-internal-vpc-access
Tags:
- Key: iks1_sg_name
Value: qbse-internal-vpc-access
- Key: iks1_sg_id
Value: sg-01e135930ae280ef2
- Key: Name
Value: qbse-internal-vpc-access
- Key: iks2:sg
Value: 'true'
VpcId:
Ref: VpcId
Type: AWS::EC2::SecurityGroup

Screenshot 2020-08-14 at 12 19 51 AM

@debankur1
Copy link
Author

@community if this change is fine can we look for other referencing issues for e.g., GroupId for SecurityGroupIngress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant