cds-snc / notification-terraform

Terraform for notification.canada.ca
MIT License
13 stars 6 forks source link

setting old permissions back #1472

Closed ben851 closed 1 month ago

ben851 commented 2 months ago

Summary | Résumé

Reverting account linking IAM in NR to the original since we seem to have lost the lambda

Test instructions | Instructions pour tester la modification

TF Apply See if api-lambda for staging exists.

Release Instructions | Instructions pour le déploiement

None.

Reviewer checklist | Liste de vérification du réviseur

⚠ If boxes cannot be checked off before merging the PR, they should be moved to the "Release Instructions" section with appropriate steps required to verify before release. For example, changes to celery code may require tests on staging to verify that performance has not been affected.

github-actions[bot] commented 2 months ago

Staging: newrelic

✅   Terraform Init: success ✅   Terraform Validate: success ✅   Terraform Format: success ❌   Terraform Plan: failed

Show plan ```terraform random_string.s3-bucket-name[0]: Refreshing state... [id=9p5x8bkb] data.newrelic_entity.notification-admin: Reading... newrelic_api_access_key.newrelic_aws_access_key[0]: Refreshing state... [id=9F996F93714DC951E0EE1F7FFCB41C1EAAFFD5F86D62617BAED5434772AA0CAA] data.newrelic_entity.notification-api-lambda: Reading... data.newrelic_entity.notification-api-k8s: Reading... newrelic_alert_policy.terraform_notify_policy: Refreshing state... [id=5457585] newrelic_notification_destination.terraform_notify_destination: Refreshing state... [id=c9eba971-c0f7-47bf-8efd-4266bf055a78] data.aws_iam_policy_document.newrelic_assume_policy: Reading... aws_iam_role.newrelic_configuration_recorder[0]: Refreshing state... [id=newrelic_configuration_recorder-staging] aws_iam_role.firehose_newrelic_role[0]: Refreshing state... [id=firehose_newrelic_role_staging] aws_s3_bucket.newrelic_aws_bucket[0]: Refreshing state... [id=newrelic-aws-bucket-9p5x8bkb] data.aws_iam_policy_document.newrelic_assume_policy: Read complete after 0s [id=2997593768] aws_config_configuration_recorder_status.newrelic_recorder_status[0]: Refreshing state... [id=aws-controltower-BaselineConfigRecorder] aws_s3_bucket.newrelic_configuration_recorder_s3[0]: Refreshing state... [id=newrelic-configuration-recorder-9p5x8bkb] aws_iam_role.metric_stream_to_firehose[0]: Refreshing state... [id=newrelic_metric_stream_to_firehose_role_staging] aws_iam_policy.newrelic_aws_permissions[0]: Refreshing state... [id=arn:aws:iam::239043911459:policy/NewRelicCloudStreamReadPermissions-staging] aws_iam_role.newrelic_aws_role[0]: Refreshing state... [id=NewRelicInfrastructure-Integrations-staging] data.newrelic_entity.notification-admin: Read complete after 0s [id=MjY5MTk3NHxBUE18QVBQTElDQVRJT058NTExMzk5NTgw] newrelic_notification_channel.terraform_notify_channel: Refreshing state... [id=3a5ec568-369c-481c-bd49-598f5d394008] newrelic_nrql_alert_condition.admin_response_time: Refreshing state... [id=5457585:43065752] newrelic_nrql_alert_condition.admin_error_percentage: Refreshing state... [id=5457585:43065753] aws_iam_role_policy_attachment.newrelic_configuration_recorder[0]: Refreshing state... [id=newrelic_configuration_recorder-staging-20240724125752973100000002] data.newrelic_entity.notification-api-k8s: Read complete after 0s [id=MjY5MTk3NHxBUE18QVBQTElDQVRJT058NTExMzk5NjEx] newrelic_nrql_alert_condition.k8s_api_transaction_database_time: Refreshing state... [id=5457585:43065749] newrelic_nrql_alert_condition.k8s_api_response_time: Refreshing state... [id=5457585:43065751] newrelic_nrql_alert_condition.k8s_api_error_percentage: Refreshing state... [id=5457585:43065750] aws_iam_role_policy_attachment.newrelic_aws_policy_attach[0]: Refreshing state... [id=NewRelicInfrastructure-Integrations-staging-20240726145155058100000001] newrelic_workflow.terraform_notify_workflow: Refreshing state... [id=29b5ae0e-6918-4d87-84c6-71ce34368fad] newrelic_cloud_aws_link_account.newrelic_cloud_integration_push[0]: Refreshing state... [id=225918] newrelic_cloud_aws_link_account.newrelic_cloud_integration_pull[0]: Refreshing state... [id=225924] aws_s3_bucket_ownership_controls.newrelic_ownership_controls[0]: Refreshing state... [id=newrelic-aws-bucket-9p5x8bkb] aws_kinesis_firehose_delivery_stream.newrelic_firehose_stream[0]: Refreshing state... [id=arn:aws:firehose:ca-central-1:239043911459:deliverystream/newrelic_firehose_stream_staging] aws_iam_role_policy.newrelic_configuration_recorder_s3[0]: Refreshing state... [id=newrelic_configuration_recorder-staging:newrelic-configuration-recorder-s3-staging] aws_iam_role_policy.metric_stream_to_firehose[0]: Refreshing state... [id=newrelic_metric_stream_to_firehose_role_staging:default] Planning failed. Terraform encountered an error while generating this plan. Error: no entities found for the provided search parameters, please ensure your schema attributes are valid with data.newrelic_entity.notification-api-lambda, on data.tf line 1, in data "newrelic_entity" "notification-api-lambda": 1: data "newrelic_entity" "notification-api-lambda" { time=2024-07-26T14:52:53Z level=error msg=Terraform invocation failed in /home/runner/work/notification-terraform/notification-terraform/env/staging/newrelic/.terragrunt-cache/LSjtUBYwy6sdqnASTiOnTk5WUmU/ziUKr5pa_JoeDZ3wgSbieuIpHJE/newrelic prefix=[/home/runner/work/notification-terraform/notification-terraform/env/staging/newrelic] time=2024-07-26T14:52:53Z level=error msg=1 error occurred: * exit status 1 ```
P0NDER0SA commented 2 months ago

it's the case of the disappearing entity.