Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kit Ewbank <Kit_Ewbank@hotmail.com>
  • Loading branch information
DrFaust92 and ewbankkit committed Oct 29, 2020
1 parent 25dd679 commit b3070a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions aws/resource_aws_storagegateway_tape_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func resourceAwsStorageGatewayTapePool() *schema.Resource {
ForceNew: true,
ValidateFunc: validation.StringInSlice(storagegateway.TapeStorageClass_Values(), false),
},
"retention_look_type": {
"retention_lock_type": {
Type: schema.TypeString,
Optional: true,
Default: storagegateway.RetentionLockTypeNone,
Expand All @@ -63,7 +63,7 @@ func resourceAwsStorageGatewayTapePoolCreate(d *schema.ResourceData, meta interf
input := &storagegateway.CreateTapePoolInput{
PoolName: aws.String(d.Get("pool_name").(string)),
StorageClass: aws.String(d.Get("storage_class").(string)),
RetentionLockType: aws.String(d.Get("retention_look_type").(string)),
RetentionLockType: aws.String(d.Get("retention_lock_type").(string)),
RetentionLockTimeInDays: aws.Int64(int64(d.Get("retention_lock_time_in_days").(int))),
Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().StoragegatewayTags(),
}
Expand Down Expand Up @@ -119,7 +119,7 @@ func resourceAwsStorageGatewayTapePoolRead(d *schema.ResourceData, meta interfac
d.Set("arn", poolArn)
d.Set("pool_name", aws.StringValue(pool.PoolName))
d.Set("retention_lock_time_in_days", aws.Int64Value(pool.RetentionLockTimeInDays))
d.Set("retention_look_type", aws.StringValue(pool.RetentionLockType))
d.Set("retention_lock_type", aws.StringValue(pool.RetentionLockType))
d.Set("storage_class", aws.StringValue(pool.StorageClass))

tags, err := keyvaluetags.StoragegatewayListTags(conn, poolArn)
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_storagegateway_tape_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAccAWSStorageGatewayTapePool_basic(t *testing.T) {
testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`tapepool/pool-.+`)),
resource.TestCheckResourceAttr(resourceName, "pool_name", rName),
resource.TestCheckResourceAttr(resourceName, "storage_class", "GLACIER"),
resource.TestCheckResourceAttr(resourceName, "retention_look_type", "NONE"),
resource.TestCheckResourceAttr(resourceName, "retention_lock_type", "NONE"),
resource.TestCheckResourceAttr(resourceName, "retention_lock_time_in_days", "0"),
),
},
Expand Down Expand Up @@ -59,7 +59,7 @@ func TestAccAWSStorageGatewayTapePool_retention(t *testing.T) {
testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`tapepool/pool-.+`)),
resource.TestCheckResourceAttr(resourceName, "pool_name", rName),
resource.TestCheckResourceAttr(resourceName, "storage_class", "GLACIER"),
resource.TestCheckResourceAttr(resourceName, "retention_look_type", "GOVERNANCE"),
resource.TestCheckResourceAttr(resourceName, "retention_lock_type", "GOVERNANCE"),
resource.TestCheckResourceAttr(resourceName, "retention_lock_time_in_days", "1"),
),
},
Expand Down Expand Up @@ -207,7 +207,7 @@ func testAccAWSStorageGatewayTapePoolRetentionConfig(rName string) string {
resource "aws_storagegateway_tape_pool" "test" {
pool_name = %[1]q
storage_class = "GLACIER"
retention_look_type = "GOVERNANCE"
retention_lock_type = "GOVERNANCE"
retention_lock_time_in_days = 1
}
`, rName)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/storagegateway_tape_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The following arguments are supported:

* `pool_name` - (Required) The name of the new custom tape pool.
* `storage_class` - (Required) The storage class that is associated with the new custom pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class that corresponds to the pool. Possible values are `DEEP_ARCHIVE` or `GLACIER`.
* `retention_look_type` - (Required) Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
* `retention_lock_type` - (Required) Tape retention lock can be configured in two modes. When configured in governance mode, AWS accounts with specific IAM permissions are authorized to remove the tape retention lock from archived virtual tapes. When configured in compliance mode, the tape retention lock cannot be removed by any user, including the root AWS account. Possible values are `COMPLIANCE`, `GOVERNANCE`, and `NONE`. Default value is `NONE`.
* `retention_lock_time_in_days` - (Optional) Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0.
* `tags` - (Optional) Key-value map of resource tags

Expand Down

0 comments on commit b3070a9

Please sign in to comment.