Skip to content

fix(config): add SourceAccount condition to Lambda permission#16617

Merged
mergify[bot] merged 2 commits intoaws:masterfrom
skinny85:fix/config-service-principal-condition
Oct 4, 2021
Merged

fix(config): add SourceAccount condition to Lambda permission#16617
mergify[bot] merged 2 commits intoaws:masterfrom
skinny85:fix/config-service-principal-condition

Conversation

@skinny85
Copy link
Copy Markdown
Contributor

According to
AWS Config best practices,
we should add a SourceAccount condition to the Lambda Permission we create in CustomRule.

Note that we cannot add the SourceArn condition,
because that would cause a cyclic dependency between the LambdaPermission resource,
and the Rule resource
(as the Rule can only be created after the LambdaPermission has been created -
this is validated by the AWS Config service -
and so needs a DependOn for the Lambda Permission).


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

According to
[AWS Config best practices](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_nodejs.html#restricted-lambda-policy),
we should add a `SourceAccount` condition to the Lambda Permission we create in `CustomRule`.

Note that we cannot add the `SourceArn` condition,
because that would cause a cyclic dependency between the `LambdaPermission` resource,
and the `Rule` resource
(as the `Rule` can only be created _after_ the `LambdaPermission` has been created -
this is validated by the AWS Config service).
@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Sep 23, 2021

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Sep 23, 2021
@skinny85 skinny85 changed the title fix(config): add SourceArn condition to Lambda permission fix(config): add SourceAccount condition to Lambda permission Sep 27, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 4, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: c249ce2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit cfcaf45 into aws:master Oct 4, 2021
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Oct 4, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

xykkong added a commit to xykkong/aws-cdk that referenced this pull request Oct 6, 2021
* '15588' of https://github.com/xykkong/aws-cdk: (47 commits)
  chore: rollback `GenericSSMParameterImage` deprecation (backport aws#16798) (aws#16800)
  chore(deps): bump actions/setup-node from 2.4.0 to 2.4.1 (aws#16778)
  Update CHANGELOG.md
  chore(release): 1.126.0
  feat(assertions): matcher support for `templateMatches()` API (aws#16789)
  feat(stepfunctions-tasks): add step concurrency level to EmrCreateCluster (aws#15242)
  docs(s3): correct heading levels Object Ownership / Bucket deletion (aws#16790)
  chore(individual-pkg-gen): fix bug in setting alpha package visibility (aws#16787)
  fix(s3): setting `autoDeleteObjects` to `false` empties the bucket (aws#16756)
  fix(iam): `User.fromUserArn` does not work for ARNs that include a path (aws#16269)
  fix(cli): progress bar overshoots count by 1 for stack updates (aws#16168)
  fix(config): add SourceAccount condition to Lambda permission (aws#16617)
  docs(events): add a note about not using `EventPattern` with `CfnRule` (aws#16715)
  docs(core): fix reference to nonexistant enum value (aws#16716)
  chore(s3-deployments): update python version on BucketDeployment handler (aws#16771)
  chore: set response-requested length to 2 and closing-soon to 5 (aws#16763)
  fix(revert): "fix: CDK does not honor NO_PROXY settings (aws#16751)" (aws#16761)
  docs(GitHub issue templates): Upgrade to GitHub Issues v2 (aws#16592)
  chore: reset jsii-rosetta worker count to default (aws#16755)
  fix: CDK does not honor NO_PROXY settings (aws#16751)
  ...
@skinny85 skinny85 deleted the fix/config-service-principal-condition branch October 6, 2021 21:56
njlynch pushed a commit that referenced this pull request Oct 11, 2021
According to
[AWS Config best practices](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_nodejs.html#restricted-lambda-policy),
we should add a `SourceAccount` condition to the Lambda Permission we create in `CustomRule`.

Note that we cannot add the `SourceArn` condition,
because that would cause a cyclic dependency between the `LambdaPermission` resource,
and the `Rule` resource
(as the `Rule` can only be created _after_ the `LambdaPermission` has been created -
this is validated by the AWS Config service -
and so needs a `DependOn` for the Lambda Permission).

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
)

According to
[AWS Config best practices](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules_nodejs.html#restricted-lambda-policy),
we should add a `SourceAccount` condition to the Lambda Permission we create in `CustomRule`.

Note that we cannot add the `SourceArn` condition,
because that would cause a cyclic dependency between the `LambdaPermission` resource,
and the `Rule` resource
(as the `Rule` can only be created _after_ the `LambdaPermission` has been created -
this is validated by the AWS Config service -
and so needs a `DependOn` for the Lambda Permission).

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants