-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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 Resource: aws_sns_application #1101
Conversation
@stack72 Please review this PR again as you have mentioned back in Dec last year you will try to look into this with a test account. |
👍 lets do this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, questions, and suggestions. Please take a look, thanks!
"log" | ||
|
||
"github.com/hashicorp/terraform/helper/schema" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: align imports here
) | ||
|
||
var SupportedPlatforms = map[string]bool{ | ||
//"ADM": true, // (Amazon Device Messaging) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ADM
is not currently supported, previously deprecated, or to be supported in the future?
}, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"name": &schema.Schema{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super minor nit: can remove all of the duplicate struct field declarations here:
"name": {
// ....
}
"credential": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ForceNew
defaults to false
, can remove
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: false, | ||
StateFunc: hashSum, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Privacy the primary reasoning for using a hashSum
here, and for principal
?
|
||
"github.com/hashicorp/terraform/helper/resource" | ||
"github.com/hashicorp/terraform/terraform" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: align imports
resource.TestCheckResourceAttr( | ||
"aws_sns_application.gcm_test", "success_sample_rate", "100"), | ||
resource.TestCheckResourceAttr( | ||
"aws_sns_application.gcm_test", "created_topic", "arn:aws:sns:us-east-1:638386993804:endpoint-created-topic"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arn
values here will change based on which user runs the acceptance test. Can use TestCheckResourceAttrSet()
to verify that the attribute was set to a value. For explicit attribute checking, I believe we have a helper function in the aws
provider to build an arn
regardless of user-id or govcloud, etc.
resource.TestCheckResourceAttr( | ||
"aws_sns_application.gcm_test", "success_sample_rate", "99"), | ||
resource.TestCheckResourceAttr( | ||
"aws_sns_application.gcm_test", "created_topic", "arn:aws:sns:us-east-1:638386993804:endpoint-created-topic-update"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
resource "aws_sns_application" "gcm_test" { | ||
name = "aws_sns_application_test" | ||
platform = "GCM" | ||
created_topic = "arn:aws:sns:us-east-1:638386993804:endpoint-created-topic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These arn's should be created during the terraform run of the acceptance test, for access reasons.
return nil | ||
} | ||
|
||
var testAccAWSSNSApplicationGCMConfig = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future updates to the resource, it helps to use a function to return a string for configuration values. This also allows you to get all the necessary environment variables for a configuration prior to writing the string.
func testAccAWSSNSApplicationGCMConfig(gcm_key string) string {
return fmt.Sprintf(`foo bar baz`)
}
Initial review looks good @iceycake + @dalehamel + @mgaqube. However, the main blocker to being able to merge this PR, is that we need testing variables for all of the extra environment variables that are now required to test this resource in the AWS provider. We run nightly acceptance tests, and will need to be able to test this resource prior to merging. Thanks again for your patience! |
@megaqube do you still have any testing token that can provide to them? |
@iceycake @grubernaut Would this be for longterm testing use or just to test with before accepting the PR? Unfortunately the API tokens for Android and IOS that I used to test are tied to our company's accounts, so I cannot share those. I do not have a personal Apple Developer account, but if you need a short term use GCM API token to test, I can probably create one with my personal account, but I will need to disable after you've tested it. Let me know if that would suffice. |
Any word on this? Looking forward to it. 👍 |
I'm looking forward to this feature as well ! Where are we at ? Any ETA ? Thanks for the great work. |
Dear community, |
Would you be able to provide such tokens & fix @grubernaut 's review? Thanks! |
@Ninir As @grubernaut mentioned 4 months ago, this test is associating additional cost for the token. To answer your question, sorry i can’t gjve out my company token as again there is $$$ associate to that. We are building our internal aws provider along with a few other unmerged PRs to get around with this issue. |
Up! Still needed in 2018. How can we help ? |
I'll be looking at this PR shortly to take it across the finish line, but if anyone could fix up the items from the initial review (as they look like items I would say/ask as well), comment on them, or at least let us know that no more development from the original authors can occur, that would be a help to getting the ball rolling here again. Thanks! |
…and rename attributes to closer match SNS attributes
I have submitted a followup PR: #3283 |
This has been released in terraform-provider-aws version 1.9.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
* commit '5293a0e3b1366ee16d8742b9b2354781a79bfbd9': (224 commits) v1.9.0 Update CHANGELOG for hashicorp#1101 and hashicorp#3283 docs/resource/aws_sns_platform_application: Add note about platform_credential and platform_principal hashing resource/aws_sns_platform_application: Refactor ID parsing to its own function, use testing.T in testAccAwsSnsPlatformApplicationPlatformFromEnv Add lambda example (hashicorp#3168) Update CHANGELOG for hashicorp#3157 docs/data-source/aws_region: Remove now deprecated current argument data-source/aws_region: Refactor logic into findRegionByEc2Endpoint and findRegionByName functions Update CHANGELOG for hashicorp#3301 Update CHANGELOG for hashicorp#2559 and hashicorp#3240 Update CHANGELOG.md resource/aws_kinesis_stream: Retry deletion on LimitExceededException (hashicorp#3108) Update CHANGELOG.md resource/aws_dynamodb_table_item: Cleanup + add missing bits Added dynamodb_table_item resource hashicorp#517 Update CHANGELOG.md New Resource: aws_cloud9_environment_ec2 Update CHANGELOG.md Fixed markdown typo in docs resource/aws_kinesis_firehose_delivery_stream: Prevent crashes on empty CloudWatchLoggingOptions and fix extended_s3_configuration kms_key_arn ... # Conflicts: # aws/validators.go
…parameters-features * commit '5293a0e3b1366ee16d8742b9b2354781a79bfbd9': (752 commits) v1.9.0 Update CHANGELOG for hashicorp#1101 and hashicorp#3283 docs/resource/aws_sns_platform_application: Add note about platform_credential and platform_principal hashing resource/aws_sns_platform_application: Refactor ID parsing to its own function, use testing.T in testAccAwsSnsPlatformApplicationPlatformFromEnv Add lambda example (hashicorp#3168) Update CHANGELOG for hashicorp#3157 docs/data-source/aws_region: Remove now deprecated current argument data-source/aws_region: Refactor logic into findRegionByEc2Endpoint and findRegionByName functions Update CHANGELOG for hashicorp#3301 Update CHANGELOG for hashicorp#2559 and hashicorp#3240 Update CHANGELOG.md resource/aws_kinesis_stream: Retry deletion on LimitExceededException (hashicorp#3108) Update CHANGELOG.md resource/aws_dynamodb_table_item: Cleanup + add missing bits Added dynamodb_table_item resource hashicorp#517 Update CHANGELOG.md New Resource: aws_cloud9_environment_ec2 Update CHANGELOG.md Fixed markdown typo in docs resource/aws_kinesis_firehose_delivery_stream: Prevent crashes on empty CloudWatchLoggingOptions and fix extended_s3_configuration kms_key_arn ... # Conflicts: # aws/resource_aws_ssm_parameter_test.go
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! |
hashicorp/terraform#8294 has been opened for almost a year and we need further discussion on how to get this merge into the aws provider.
@megaqube @bigkraig @mikecook @etartakovsky please comment on this as we all really need this PR.