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

New Data Source: aws_storagegateway_gateway_activation_key #5200

Merged
merged 1 commit into from
Jul 16, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jul 16, 2018

Reference: #943

Changes proposed in this pull request:

  • New data source for fetching Storage Gateway activation key from on-premises or EC2 instance gateway

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSStorageGatewayGatewayActivationKeyDataSource_FileGateway'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSStorageGatewayGatewayActivationKeyDataSource_FileGateway -timeout 120m
=== RUN   TestAccAWSStorageGatewayGatewayActivationKeyDataSource_FileGateway
--- PASS: TestAccAWSStorageGatewayGatewayActivationKeyDataSource_FileGateway (242.01s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	242.048s

@bflad bflad added new-resource Introduces a new resource. service/storagegateway Issues and PRs that pertain to the storagegateway service. labels Jul 16, 2018
@bflad bflad requested a review from a team July 16, 2018 13:38
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Jul 16, 2018
@bflad
Copy link
Contributor Author

bflad commented Jul 16, 2018

This logic might get folded into the an aws_storagegateway_gateway resource instead -- I am going to test the workflow in that type of resource setup.

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM 👍

aws/provider.go Outdated
@@ -581,6 +581,7 @@ func Provider() terraform.ResourceProvider {
"aws_ssm_patch_group": resourceAwsSsmPatchGroup(),
"aws_ssm_parameter": resourceAwsSsmParameter(),
"aws_ssm_resource_data_sync": resourceAwsSsmResourceDataSync(),
"aws_storagegateway_gateway_activation_key": resourceAwsStorageGatewayGatewayActivationKey(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe aws_storagegateway_gateway_activation_key wants to be aws_storage_gateway_activation_key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry meant to reply to this directly as well -- we're trying to keep the resource/data source names as follows: aws_SERVICE_THING. In this case, the service is storagegateway to match the SDK and the thing is a gateway activation key (in case they introduce some other "activation key"s) which is used specifically for activating gateways via ActivateGateway.

},
Timeout: time.Second * 10,
}
requestURL := fmt.Sprintf("http://%s/?activationRegion=%s", ipAddress, activationRegion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels like this wants a "this is a special configuration and we don't support using resources in this manor; please use the AWS SDK where possible" disclaimer?


~> **NOTE:** Terraform must be able to make an HTTP (port 80) GET request to the specified IP address from where it is running.

~> **NOTE:** Deleting this Terraform resource does not perform any operations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then should this be a data source?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-implemented as data source after I figured out that data sources also support configurable timeouts 😄

@bflad bflad force-pushed the f-aws_storagegateway_gateway_activation_key branch from 415c622 to f5d7664 Compare July 16, 2018 14:37
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Jul 16, 2018
@bflad bflad changed the title New Resource: aws_storagegateway_gateway_activation_key New Data Source: aws_storagegateway_gateway_activation_key Jul 16, 2018
@bflad bflad added new-data-source Introduces a new data source. and removed new-resource Introduces a new resource. labels Jul 16, 2018
@bflad bflad added this to the v1.28.0 milestone Jul 16, 2018
@bflad bflad merged commit f5889fc into master Jul 16, 2018
@bflad bflad deleted the f-aws_storagegateway_gateway_activation_key branch July 16, 2018 16:41
bflad added a commit that referenced this pull request Jul 16, 2018
@ghost
Copy link

ghost commented Apr 4, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/storagegateway Issues and PRs that pertain to the storagegateway service. size/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants