Has anyone had problems with API Gateway and getti...
# aws
b
Has anyone had problems with API Gateway and getting the correct value for a CNAME record to point to the gateway? The API Gateway has an ID as well as a gateway domain name. When using a custom domain name, the Route 53 record seems to need to be a CNAME that points to the gateway domain name (and not the ID) otherwise you get an SSL certificate bad domain error. However, the only output in Pulumi for Api Gateway seems to be the apiEndpoint which maps to the ID but there doesn't seem to be an output for gateway domain name. Any ideas? As an example, for my gateway, the ID is tl25su6oel.execute-api.eu-west-2.amazonaws.com but the API Gateway Domain Name is d-yt93fcyxyr.execute-api.eu-west-2.amazonaws.com. It's the api gateway domain output I need
b
There are a few API gateway-specific things to do - one sec I have an example
b
Thanks @bumpy-grass-54508 I actually found it. The output is part of a different resource in Pulumi. It's an output of domain name 🙂
b
I'm using dotnet, and my setup looks like this:
Copy code
var apiGw = new ApiGatewayV2.Api(...);

var httpsCert = new Acm.Certificate(...); // and dns validation and verification and all that

var apiGwDomainName = new ApiGatewayV2.DomainName("apigw-domain-name", new {
    Domain = "<http://my-domain-name.com|my-domain-name.com>",
    DomainNameConfiguration = new {
        ...
        CertificateArn = httpsCert.CertificateArn,
        EndpointType = "REGIONAL", // might be specific to me, idk if you need this
    }
});

var dnsRecord = new Route53.Record(.., new {
    Name = "<http://my-domain-name.com|my-domain-name.com>",
    ZOneId = ...,
    Type = A,
    Aliases = new {
        Name = apiGwDomainName.DomainNameConfiguration.Apply(x => x.TargetDomainName),
        ZoneId = apiGwDomainName.DomainNameConfiguration.Apply(x => x.HostedZoneId),
        EvaluateTargetHealth = false,
    }
});
ah dang beat me to it haha
b
thanks anyway !!
b
you got it 👍