Open corrjo opened 1 year ago
Thanks for reporting this, I was able to reproduce failure here.
I found I was able to work around this if I use fromDomainAttributes
and specify the arn as well. We should provide the option to import from just the endpoint without requiring the value of the endpoint to be known at synth. However to provide this option we may need to require that other info is known (such as the domain name) so that we can construct the arn of the domain if not provided
Describe the bug
opensearchservice.Domain.fromDomainEndpoint unable to us parameters to resolve domain and create IDomain
example:
https://github.com/aws/aws-cdk/blob/74318c7d22bfc00de9e005f68a0a6aaa58c7db39/packages/%40aws-cdk/aws-opensearchservice/lib/domain.ts#L1730 Creates the url using url.URL, which is a great way to verify its valid, but since the input is a token until deploy it won't resolve
Expected Behavior
I would expect it to create an IDomain using the Token
Current Behavior
only works if input is a valid url at synth time
Reproduction Steps
Create a parameter store parameter at /path/to/my/param containing the OS Domain endpoint url
Possible Solution
don't use url.URL
Additional Information/Context
No response
CDK CLI Version
2.63.1
Framework Version
No response
Node.js Version
v18.12.1
OS
macos
Language
Typescript
Language Version
No response
Other information
No response