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

update GuLogShippingPolicy to bring it's own parameter #137

Merged
merged 2 commits into from
Jan 13, 2021
Merged

Conversation

akash1810
Copy link
Member

What does this change?

We've established best practice for accounts/stacks to define the kinesis stream to send logs to to be a SSM Parameter called /account/services/logging.stream.name.

This updates GuLogShippingPolicy to add the parameter to the stack within that construct. The construct is bringing its own resources with it, rather than being passed in as props. This makes it more self contained.

This builds on the BYO* pattern introduced in #91.

Does this change require changes to existing projects or CDK CLI?

Yes! The signature of InstanceRole has changed to no longer require a stream name, but simply a includeLogShipping boolean.

How to test

  • Observe CI?

How can we measure success?

Simpler interface to InstanceRole and more self contained constructs.

Have we considered potential risks?

n/a

We've established best practice for accounts/stacks to define the kinesis stream to send logs to to be a SSM Parameter called `/account/services/logging.stream.name`.

This updates `GuLogShippingPolicy` to add the parameter to the stack within that construct. The construct is bringing its own resources with it, rather than being passed in as props. This makes it more self contained.
@akash1810 akash1810 requested a review from a team January 13, 2021 16:45
src/patterns/instance-role.ts Outdated Show resolved Hide resolved
Tweak InstanceRoleProps to make log shipping opt-out, rather than forcing the `includeLogShipping` prop to be set.
@@ -10,7 +10,8 @@ import {
GuSSMRunCommandPolicy,
} from "../constructs/iam";

interface InstanceRoleProps extends GuGetS3ObjectPolicyProps, Partial<GuLogShippingPolicyProps> {
interface InstanceRoleProps extends GuGetS3ObjectPolicyProps {
withoutLogShipping?: boolean; // optional to have log shipping added by default, you have to opt out
Copy link
Member Author

Choose a reason for hiding this comment

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

We might want to start using https://typedoc.org/ to generate a documentation site and also provide hints via IDEs IntelliSense features.

@akash1810 akash1810 added the needs-new-release Identifying significant changes to the library label Jan 13, 2021
@akash1810 akash1810 merged commit d240cb1 into main Jan 13, 2021
@akash1810 akash1810 deleted the aa-byo branch January 13, 2021 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-new-release Identifying significant changes to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants