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

r/aws_datasync_task: allow removal of schedule #35282

Merged
merged 3 commits into from
Jan 16, 2024
Merged

Conversation

johnsonaj
Copy link
Contributor

@johnsonaj johnsonaj commented Jan 12, 2024

Description

Removing the schedule from a task should clear it completely.

Initial config

resource "aws_datasync_task" "test" {
  destination_location_arn = aws_datasync_location_s3.test1.arn
  name                     = local.name1
  source_location_arn      = aws_datasync_location_s3.test2.arn

  options {
    posix_permissions = "NONE"
    verify_mode       = "ONLY_FILES_TRANSFERRED"
    gid               = "NONE"
    uid               = "NONE"
  }

  schedule {
    schedule_expression = "cron(0/60 * * * ? *)"
  }
}

update:

resource "aws_datasync_task" "test" {
  destination_location_arn = aws_datasync_location_s3.test1.arn
  name                     = local.name1
  source_location_arn      = aws_datasync_location_s3.test2.arn

  options {
    posix_permissions = "NONE"
    verify_mode       = "ONLY_FILES_TRANSFERRED"
    gid               = "NONE"
    uid               = "NONE"
  }
}

Should result with a task that does not have a schedule

% make testacc TESTARGS="-run=TestAccDataSyncTask_schedule" PKG=datasync

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/datasync/... -v -count 1 -parallel 20  -run=TestAccDataSyncTask_schedule -timeout 360m
=== RUN   TestAccDataSyncTask_schedule
=== PAUSE TestAccDataSyncTask_schedule
=== CONT  TestAccDataSyncTask_schedule
    task_test.go:108: Step 4/4 error: Check failed: Check 2/2 error: aws_datasync_task.test: Attribute 'schedule.#' expected "0", got "1"
--- FAIL: TestAccDataSyncTask_schedule (211.80s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/datasync	215.445s
FAIL
make: *** [testacc] Error 1

Relations

References

Output from Acceptance Testing

% make testacc TESTARGS="-run=TestAccDataSyncTask_" PKG=datasync

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/datasync/... -v -count 1 -parallel 20  -run=TestAccDataSyncTask_ -timeout 360m
--- PASS: TestAccDataSyncTask_disappears (167.35s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_preserveDevices (194.46s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_posixPermissions (207.03s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_overwriteMode (213.79s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_atimeMtime (222.90s)
--- PASS: TestAccDataSyncTask_taskReportConfig (228.46s)
--- PASS: TestAccDataSyncTask_includes (233.07s)
--- PASS: TestAccDataSyncTask_basic (235.71s)
--- PASS: TestAccDataSyncTask_excludes (235.77s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_gid (236.73s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_objectTags (258.01s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_transferMode (260.19s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_verifyMode (262.29s)
--- PASS: TestAccDataSyncTask_cloudWatchLogGroupARN (266.44s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_preserveDeletedFiles (268.05s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_bytesPerSecond (290.96s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_uid (307.93s)
--- PASS: TestAccDataSyncTask_schedule (309.96s)
--- PASS: TestAccDataSyncTask_tags (312.68s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_taskQueueing (158.72s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_logLevel (327.78s)
--- PASS: TestAccDataSyncTask_DefaultSyncOptions_securityDescriptorCopyFlags (3130.11s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/datasync	3328.183s

Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. service/datasync Issues and PRs that pertain to the datasync service. labels Jan 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jan 12, 2024
@johnsonaj johnsonaj added the bug Addresses a defect in current functionality. label Jan 12, 2024
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@johnsonaj johnsonaj marked this pull request as ready for review January 12, 2024 23:09
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Jan 12, 2024
@johnsonaj johnsonaj merged commit bd1dd5c into main Jan 16, 2024
37 checks passed
@johnsonaj johnsonaj deleted the b-datasync_task_schedule branch January 16, 2024 15:32
@github-actions github-actions bot added this to the v5.33.0 milestone Jan 16, 2024
github-actions bot pushed a commit that referenced this pull request Jan 16, 2024
@github-actions github-actions bot removed the bug Addresses a defect in current functionality. label Jan 18, 2024
Copy link

This functionality has been released in v5.33.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 pull request 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 related to this change, 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 Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/datasync Issues and PRs that pertain to the datasync service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant