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

Enable Attribute References for Nested Types #172

Closed
skorfmann opened this issue Jul 15, 2020 · 7 comments
Closed

Enable Attribute References for Nested Types #172

skorfmann opened this issue Jul 15, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@skorfmann
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Some providers (at least the Kubernetes provider) allow attribute references on anonymous interfaces (see #170). It would be good to support this.

That would be something like this:

const namespace = new Namespace(this, 'foo', {})
namespace.inputs.generation

References

#170

@juliankrispel
Copy link

juliankrispel commented Dec 14, 2020

This issue blocked me from migrating this example from the terraform docs the other day:

resource "aws_route53_record" "example" {
  name    = aws_apigatewayv2_domain_name.example.domain_name
  type    = "A"
  zone_id = aws_route53_zone.example.zone_id

  alias {
    name                   = aws_apigatewayv2_domain_name.example.domain_name_configuration[0].target_domain_name
    zone_id                = aws_apigatewayv2_domain_name.example.domain_name_configuration[0].hosted_zone_id
    evaluate_target_health = false
  }
}

domain_name_configuration[0] doesn't currently contain either target_domain_name or hosted_zone_id

Until this is fixed, a suitable workaround would be to use the escape hatch:

yourRoute53Record.addOverride(‘alias.name’, `${yourGateway.fqn}.domain_name_configuration[0].target_domain_name`)

@skorfmann
Copy link
Contributor Author

@juliankrispel thanks for the the additional input. I believe we could leverage the mapping which got introduced by #395 to create a custom mapping similar to this.

@DanielMSchmidt
Copy link
Contributor

@skorfmann I think this is supported now in 0.7.0, wdyt?

@jsteinich
Copy link
Collaborator

@skorfmann I think this is supported now in 0.7.0, wdyt?

I don't think this is fully covered yet. The initial description got picked up, but some of the comments and linked issues I believe to still be missing.

@DanielMSchmidt
Copy link
Contributor

I looked into @juliankrispel example, the only thing missing to make this happen is including computed types on the complex objects. So not closed, but close to being closed

@DanielMSchmidt
Copy link
Contributor

Tracking this in #1332 which is a dedicated issue for the use case mentioned in the comments 👍

@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
4 participants