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 (de)activating an AWS appflow with a pseudo-resource #25085

Closed
ulich opened this issue May 27, 2022 · 2 comments
Closed

Support (de)activating an AWS appflow with a pseudo-resource #25085

ulich opened this issue May 27, 2022 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/appflow Issues and PRs that pertain to the appflow service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@ulich
Copy link

ulich commented May 27, 2022

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

In order to create an AWS appflow that is connecting Salesforce to EventBridge, you have to create the resources in a specific order and in the end activate the appflow:

  1. Create the appflow. The value for destination_flow_config.destination_connector_properties.event_bridge.object will define the name of the EventBridge Partner Source that will be created by AWS behind the scenes automatically. This works with the aws_appflow_flow resource. The appflow will be in "Draft" state.
  2. Create the EventBridge bus with the same name as destination_flow_config.destination_connector_properties.event_bridge.object. This will implicitly connect the EventBridge Partner Source to the EventBridge Bus.
  3. Now that an event bus is available and connected to the Partner Event Source, AWS lets you activate the flow and only from there on the flow will be working.

As a workaround, we currently do this, but on terraform cloud this becomes even quirkier due to not having the aws cli installed:

resource "null_resource" "activate_flow" {
  triggers = {
    flow_name = aws_appflow_flow.example.name
  }

  provisioner "local-exec" {
    command = "aws appflow start-flow --flow-name ${self.triggers.flow_name}"
  }

  provisioner "local-exec" {
    when = destroy
    command = "aws appflow stop-flow --flow-name ${self.triggers.flow_name}"
  } 

  depends_on = [
    aws_cloudwatch_event_bus.example
  ]
}

New or Affected Resource(s)

  • aws_appflow_flow_activation

Potential Terraform Configuration

resource "aws_appflow_flow_activation" "example" {
  flow_name = aws_appflow_flow.example.name

  depends_on = [
    aws_cloudwatch_event_bus.example
  ]
}

The idea would be to activate the flow when the resource is supposed to be created and deactivate the flow when the resource is supposed to be destroyed. This way an appflow that is currently in activate state can also be deleted, which is not possible right now.

References

@ulich ulich added the enhancement Requests to existing resources that expand the functionality or scope. label May 27, 2022
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/appflow Issues and PRs that pertain to the appflow service. labels May 27, 2022
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jun 6, 2022
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label May 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2024
Copy link

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 have 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 Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/appflow Issues and PRs that pertain to the appflow service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

2 participants