-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
r/aws_connect_contact_flow - add new resource #16854
Conversation
34c8da0
to
5755f13
Compare
Even though it doesn't strictly match the AWS API, it might be worth considering turning this into two separate resources: the contact flow and the flow actions. It's a common pattern for two contact flows to reference each other (eg. go back to menu). As currently implemented, this results in a cycle. |
Hi, I'm unsure of what you mean by "flow actions" as a resource, this cyclic dependency will always be an issue, unless you think we run through contacts flows on initial create its an empty contact flow and then add the content? Do you have examples of where this is implemented as an AWS pattern in the provider? |
By "flow actions" I mean the individual blocks which make up the flow (Disconnect, Play Prompt, etc.). In the JSON for a contact flow, they are in an array called "Actions". I don't know of a place where something is implemented like this in the provider, as I've only started using Terraform due to client requirements and found this pull request during my research. But I have implemented a custom resource for the AWS CDK (which my company normally uses) to solve the same problem. The only gotcha is, due to the API publishing the contact flow when it's created, any call to I anticipate it would look something like this resource "aws_connect_contact_flow" "example" {
instance_id = "aaaaaaaa-bbbb-cccc-dddd-111111111111"
name = "Test"
description = "Test Contact Flow Description"
type = "CONTACT_FLOW"
# content = file("flowFile") # Possibly leave content here to optionally be filled if cycles aren't an issue
}
resource "aws_connect_contact_flow_content" "example_content" {
instance_id = "aaaaaaaa-bbbb-cccc-dddd-111111111111"
contact_flow_id = aws_connect_contact_flow.example.id
content = templatefile("flowFileWithDependencies", { otherFlowArn = aws_connect_contact_flow.other.arn })
} I don't like that it requires the workaround of creating the initial minimal flow, but it's a limitation of the API that an empty flow can't be created. Not solving the cycle issue, though, makes it ultimately unusable in a lot of cases. |
Thats going to be really difficult to synchronise the state to the remote terraform state as there is not resource id for logical parts of a contact flow definition so that your can remerge the individual actions back to an update request. I use the API at the moment in the grain defined here very effectively, it's just not managed in the terraform lifecycle, also I cannot easily reference lambda and lex resources managed by terraform, which is what this will allow |
@thornleyk did you merge in the other PR from @abebars ? I see substantially similar code in your PR to theirs (#16709) |
Yeah I'm still waiting on terraform to merge @abebars original PR once that happens I'll rebase and finish this PR I'm dependent on that PR |
I'm going to fetch upstream/main and then port some of your changes into PR #16709. |
|
Need to finish the |
@thornleyk can you remove the WIP prefix? |
cd3b3be
to
e24e9a4
Compare
Hi @thornleyk 👋 I'm giving this PR another pass before we merge. Overall it's looking great, just a couple small updates in the data source for now e.g. marking fields as |
Thanks a bunch angie!!, I'll keep these updates in mind for the other resources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing to this PR @thornleyk @AdamTylerLynch 🚀 ! I've added a couple finishing touches to the resource to get this into our upcoming release.
Output of acceptance tests:
--- PASS: TestAccAwsConnectContactFlowDataSource_Name (87.75s)
--- PASS: TestAccAwsConnectContactFlowDataSource_ContactFlowId (123.12s)
--- PASS: TestAccAwsConnectContactFlow_serial (0.00s)
--- PASS: TestAccAwsConnectContactFlow_serial/basic (100.41s)
--- PASS: TestAccAwsConnectContactFlow_serial/disappears (77.36s)
--- PASS: TestAccAwsConnectContactFlow_serial/filename (101.17s)
fc116bf
to
35a806f
Compare
This functionality has been released in v3.60.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Relates #16392 #16854
Release note for CHANGELOG:
Output from acceptance testing: