Created
February 4, 2021 14:06
-
-
Save MatthewJDavis/985f5e6dec08b7f70d3b87327f5ac546 to your computer and use it in GitHub Desktop.
Get ID of AWS cloudwatch event target
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To use the terraform import aws_cloudwatch_event_target provider, we need the rule name and target ID. To find the target ID, | |
# run the following with the AWS cli. | |
aws events list-targets-by-rule --rule "ruleName" | |
# This will return the following and the ID can be used to import the resource. | |
#{ | |
# "Targets": [ | |
# { | |
# "Id": "Id123456789", | |
# "Arn": "arn:aws:lambda:eu-west-1:123456789:function:Name" | |
# } | |
# ] | |
#} | |
# Can then import the cloudwatch event target with: | |
terraform import aws_cloudwatch_event_target.daily_lambda ruleName/Id123456789 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment