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

Support replace_triggered_by #134

Open
t0yv0 opened this issue Apr 5, 2024 · 0 comments
Open

Support replace_triggered_by #134

t0yv0 opened this issue Apr 5, 2024 · 0 comments
Labels
kind/enhancement Improvements or new features

Comments

@t0yv0
Copy link
Member

t0yv0 commented Apr 5, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Terraform supports the lifecycle configuration replace_triggered_by. Top resource examples in AWS use this, including aws.lambda.Permission and aws.ec2.SecurityGroup. It is not immediately clear to me how to accomplish this in Pulumi, so perhaps we need to figure out the gaps here before addressing the translation per se - nothing in https://www.pulumi.com/docs/concepts/options/ is immediately obvious to use here.

Beside examples I suspect this idiom will be something that users migrating from TF would be wondering about when working with Pulumi.

If omitting the qualifier argument (which forces re-creation each time a function version is published), a lifecycle block can be used to ensure permissions are re-applied on any change to the underlying function.

resource "aws_lambda_permission" "logging" {
  action        = "lambda:InvokeFunction"
  function_name = aws_lambda_function.example.function_name
  principal     = "events.amazonaws.com"
  source_arn    = "arn:aws:events:eu-west-1:111122223333:rule/RunDaily"

  lifecycle {
    replace_triggered_by = [
      aws_lambda_function.example
    ]
  }
}

Affected area/feature

@t0yv0 t0yv0 added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Apr 5, 2024
@justinvp justinvp removed the needs-triage Needs attention from the triage team label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants