AWS Cloudformation export not named error, using importValue on nested stacks

61 Views Asked by At

I want to output my certificate ACM reasource that I created within acm.yaml to be able use it in my cf.yaml template .

I want to create a regional acm certificate within my acm.yaml and then import it into my cf.yaml nested stack.

  
  AcmRegional:
    Type: AWS::CertificateManager::Certificate
    Properties:
      DomainName: !Sub
        - 'xx-${dom}'
        - dom:
            Fn::ImportValue: !Sub 'xx-${Comp}.${Dom}'
      DomainValidationOptions:
        - DomainName: !Sub
          - 'xx-${dom}'
          - dom:
              Fn::ImportValue: !Sub 'xx-${Comp}.${Dom}'
          HostedZoneId: !FindInMap [AwsDomains, !Ref ParentDomain, !Ref DeploymentId]
      ValidationMethod: 'DNS'


....
.
.
.
Outputs:
  StackCertificate:
    Value: !Ref AcmRegional
    Export:
      Name: "AcmCertificateArnExport"
 

This is to call the created Acm certificate to my cf.yaml

...
..

  AGWDomain:
    Type: AWS::CloudFormation::Stack
    Properties:
      TemplateURL: "test.com"
      Parameters:
        Environment: !Ref Env
        CertificateArn: 
          Fn::ImportValue: AcmCertificateArnExport

The problem that I am getting is an error stating that the "No export named AcmCertificateArnExport found"

I've attempted to create the certificate within the cf.yaml but that creates a circular dependancy.

I have searched everywhere and can't see where I am not calling it. I'm also not using the short form of the ImportValue.

0

There are 0 best solutions below