Skip to content

Conversation

@AnthonyPoschen
Copy link

Issue #, if available: #147

Description of changes:
Added extra variables to the request used by custom resources

  • NextToken
  • StackID
  • StackTags
  • Region
  • AccountID
  • SystemTags

change is missing Partitions (not sure where / what that is) also missing a way to correctly do makeTestEventFunc

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AnthonyPoschen
Copy link
Author

not happy with how bloated the NewRequest function has become with these additions. Would like to narrow how many variables go into the function.

@AnthonyPoschen
Copy link
Author

AnthonyPoschen commented Jul 9, 2020

and i am not sure how to solve my 2 "todo" items as the relevant sections were labeled internal to RPDK and where i would go to make such edits or if i even should be doing that.

// resourceHandlerRequest is internal to the RPDK. It contains a number of fields that are for
// internal contract testing use only.

@wbingli
Copy link

wbingli commented Jul 14, 2020

Thanks for your contribution. We will take a look shortly.

Copy link

@ammokhov ammokhov left a comment

Choose a reason for hiding this comment

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

good start. do you think we should add awsPartition as well?

@rjlohan
Copy link
Contributor

rjlohan commented Jul 14, 2020

FWIW, Partition is useful to help structure an AWS Arn: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html

Beyond that it's probably marginal value and is unlikely to have use outside of AWS types.

good start. do you think we should add awsPartition as well?

We can probably use the same idea I proposed here: aws-cloudformation/cloudformation-cli-python-plugin#107

@AnthonyPoschen
Copy link
Author

@rjlohan would it make more sense if every plugin was going to make this estimation that it be centrally managed potentially within cloudformation-cli to make changes for maintainability to be easier should they change in the future and the plugins simply just read a value off the request and pass through? (no idea on that workload haven't had a big read of that repo).

if everyone is happy to have the tech debt i can make the changes in this PR to include the equivalent of aws-cloudformation/cloudformation-cli-python-plugin#107 (comment)

@AnthonyPoschen
Copy link
Author

aws-cloudformation/cloudformation-cli#502

seems like this adds the extra things needed to do this in a simple way. regarding the testing side.

gbernady pushed a commit to gbernady/cloudformation-cli-go-plugin that referenced this pull request Jul 31, 2020
gbernady pushed a commit to gbernady/cloudformation-cli-go-plugin that referenced this pull request Jul 31, 2020
gbernady pushed a commit to gbernady/cloudformation-cli-go-plugin that referenced this pull request Jul 31, 2020
gbernady pushed a commit to gbernady/cloudformation-cli-go-plugin that referenced this pull request Jul 31, 2020
@wbingli
Copy link

wbingli commented Aug 6, 2020

@rjlohan would it make more sense if every plugin was going to make this estimation that it be centrally managed potentially within cloudformation-cli to make changes for maintainability to be easier should they change in the future and the plugins simply just read a value off the request and pass through? (no idea on that workload haven't had a big read of that repo).

if everyone is happy to have the tech debt i can make the changes in this PR to include the equivalent of aws-cloudformation/cloudformation-cli-python-plugin#107 (comment)

I'm afraid this will be plugin by plugin, we cannot address it on the cloudformation-cli. The cloudformation-cli and other plugin PyPi packages are providing build time tooling support, it doesn't provide runtime support.

I think it would be good to just include the change done in Python plugin aws-cloudformation/cloudformation-cli-python-plugin#107 (comment)

request := handler.NewRequest(
event.Request.LogicalResourceIdentifier,
event.Request.NextToken,
"", //TODO: understand how to fix this to use a proper value
Copy link

Choose a reason for hiding this comment

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

I think it should be the same as above event.StackID and event.RequestData.StackTags.

@wbingli
Copy link

wbingli commented Aug 25, 2020

Close with PR #157

@wbingli wbingli closed this Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants