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

the parameter day_of_week of maintenance_start_time in aws_storagegateway_gateway source block can't be 0 #26597

Closed
beyu2022 opened this issue Sep 1, 2022 · 4 comments · Fixed by #34015
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/storagegateway Issues and PRs that pertain to the storagegateway service.
Milestone

Comments

@beyu2022
Copy link

beyu2022 commented Sep 1, 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

Terraform CLI and Terraform AWS Provider Version

Terraform v1.2.8 on darwin_amd64
AWS Provider Version 4.28.0

Affected Resource(s)

  • aws_storagegateway_gateway

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_storagegateway_gateway" "storage-gateway" {
  gateway_ip_address = aws_instance.server.public_ip
  gateway_name       = "awsdev-storagegateway"
  gateway_timezone   = "GMT-8:00"
  gateway_type       = "FILE_S3"

  # How long to wait for gateway activation and connection to Storage Gateway
  timeouts {
    create = "5m"
  }

  #maintenance start time sunday 08:30
  maintenance_start_time {
    day_of_week = 0
    hour_of_day = 8
    minute_of_hour = 30
  }
}

Debug Output

if set parameter day_of_week not zero value (1-6),terraform can apply successfully with correct update on aws.
try run by using aws cli ,it can use zero value. conside can't use zero value via terraform.

aws --profile eng storagegateway update-maintenance-start-time --gateway-arn arn:aws:storagegateway:us-west-2:xxxxxxxxxxxxx:gateway/sgw-XXXXXXXX --day-of-week 0 --hour-of-day 8 --minute-of-hour 30
{
"GatewayARN": "arn:aws:storagegateway:us-west-2:xxxxxxxxxxxx:gateway/sgw-XXXXXXXX"
}

Panic Output

│ Error: error updating Storage Gateway Gateway (arn:aws:storagegateway:us-west-2:xxxxxxxxxxxx:gateway/sgw-XXXXXXXX) maintenance start time: InvalidGatewayRequestException: Either one of DayOfMonth or DayOfWeek must be specified
│ {
│ RespMetadata: {
│ StatusCode: 400,
│ RequestID: "69176e4f-2a7b-4103-a03f-xxxxxxxxxxxx"
│ },
│ Error_: {
│ ErrorCode: "InvalidParameters"
│ },
│ Message_: "Either one of DayOfMonth or DayOfWeek must be specified"
│ }

│ with aws_storagegateway_gateway.storage-gateway,
│ on main.tf line 48, in resource "aws_storagegateway_gateway" "storage-gateway":
│ 48: resource "aws_storagegateway_gateway" "storage-gateway" {


Releasing state lock. This may take a few moments...

Expected Behavior

based on document, if set parameter day_of_week = 0 , after terraform apply, it should update the maintenance start time of storagegateway to Sunday 08:30.

Actual Behavior

get the panic output with errorCode "InvalidParameters" and massage "Either one of DayOfMonth or DayOfWeek must be specified"

Steps to Reproduce

  1. terraform apply

Important Factoids

References

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/storagegateway_gateway

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/storagegateway Issues and PRs that pertain to the storagegateway service. labels Sep 1, 2022
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 13, 2022
@dublinsubway
Copy link

I can try to tackle it if folks are okay with me taking (reasonably) long time.

@sodle
Copy link
Contributor

sodle commented Oct 19, 2023

#34015 will fix this.

@github-actions github-actions bot added this to the v5.23.0 milestone Oct 20, 2023
@github-actions
Copy link

This functionality has been released in v5.23.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!

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 Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/storagegateway Issues and PRs that pertain to the storagegateway service.
Projects
None yet
4 participants