aws-openai icon indicating copy to clipboard operation
aws-openai copied to clipboard

🐛 No Instructions for CloudWatch and ARN configuration during terraform apply

Open williamtbarker opened this issue 1 year ago • 6 comments

Description

No Instructions for CloudWatch and ARN configuration during terraform apply. Had to create a conda environment to isolate terraform to get it to behave, then was able to proceed with terraform init and terraform plan, but terraform apply gives a cloudwatch ARN error that I can't resolve

Reproduction URL

https://github.com/williamtbarker/aws-openai

Reproduction steps

1. created terraform conda environment and activated it, conda install terraform
2. cd terraform && terraform init
3. terraform plan
4. terraform apply gives error

Screenshots

![DESCRIPTION](LINK.png)

Logs

aws_api_gateway_stage.openai: Modifying... [id=ags-zwu2mfsjzj-v1]
aws_api_gateway_stage.openai: Modifications complete after 1s [id=ags-zwu2mfsjzj-v1]
aws_api_gateway_method_settings.openai: Creating...
╷
│ Error: updating API Gateway Stage failed: BadRequestException: CloudWatch Logs role ARN must be set in account settings to enable logging
│ 
│   with aws_api_gateway_method_settings.openai,
│   on apigateway.tf line 117, in resource "aws_api_gateway_method_settings" "openai":
│  117: resource "aws_api_gateway_method_settings" "openai" {
│ 
╵

Browsers

Chrome

OS

Mac

williamtbarker avatar Dec 07 '23 20:12 williamtbarker

@williamtbarker the screen shot image didn't upload for some reason. I'm guessing there's something wrong w my policy configuration for GitHub Issues. But while I investigate you can email it to me if you'd like, at [email protected], and i'll ensure that it gets uploaded.

lpm0073 avatar Dec 07 '23 20:12 lpm0073

Screenshot 2023-12-07 at 3 58 30 PM

williamtbarker avatar Dec 07 '23 20:12 williamtbarker

I should also mention that I am running an M2 mac (hence the problems with terraform installed by brew, had to run terraform through conda to resolve dependency issues)

williamtbarker avatar Dec 07 '23 21:12 williamtbarker

That's interesting. I'm also running on M2; a 2022 MacBook Air. I didn't run into this problem, but I'm unsure what the difference might be between our two seemingly similar environments.

lpm0073 avatar Dec 07 '23 21:12 lpm0073

Adding depends_on seems solving the problem image

jmontagne avatar Dec 09 '23 18:12 jmontagne

@jmontagne thanks. that kind of makes sense in that ApiGatewayAccountSetting might not be an explicit dependent. but i'm still curious about why similar hardware/os would lead to different results.

Just thinking out loud: it seems that wiping the project from your dev environment, and re-cloning, and re-initializing "from scratch" isn't enough, possibly bc hcl also caches artifacts in your home folder. but having said, my M2 is now more than a year old, and I can't image any hcl artifact surviving this long inside of a caching environment.

i'll continue to research.

lpm0073 avatar Dec 10 '23 13:12 lpm0073