I have Cloudformation template something like this
Resources:
WafValidHostsCondition:
Type: AWS::WAF::ByteMatchSet
Properties:
Name: !Sub ${AccountCode}-${RegionCode}-${Application}-waf-validhosts
ByteMatchTuples:
- FieldToMatch:
Type: HEADER
Data: host
TargetString: !Ref PublicDns
TextTransformation: NONE
PositionalConstraint: EXACTLY
WafValidHostsRule:
Type: AWS::WAF::Rule
Properties:
Name: !Sub ${AccountCode}-${RegionCode}-${Application}-waf-validhosts-rule
MetricName: WafValidHostsRule
Predicates:
- DataId: !Ref WafValidHostsCondition
Negated: true
Type: ByteMatch
WebAcl:
Type: AWS::WAF::WebACL
Properties:
Name: !Sub ${AccountCode}-${RegionCode}-${Application}-globalwebacl
DefaultAction:
Type: ALLOW
MetricName: GlobalWebACL
Rules:
- Action:
Type: BLOCK
Priority: 1
RuleId: !Ref WafValidHostsRule
And I wanna convert it to terraform code.
Yeah I can do it manually , but there are a lot :)
I don't wanna use resource aws_cloudformation_stack, because we are migrating all the stuff from cloudformation to terraform.
Also I have found this tool https://github.com/humanmade/cf-to-tf , but it work when I have existing CloudFormation Stack.
Is there any way to do it by script by tool or another way?
Thanks in advance