Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
msambol committed Feb 17, 2024
1 parent 5862a48 commit d1b1fb6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-s3/test/bucket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ describe('bucket', () => {
});
});

test('enforceSSL can be enabled', () => {
test('enforceSsl can be enabled', () => {
const stack = new cdk.Stack();
new s3.Bucket(stack, 'MyBucket', { enforceSSL: true });

Expand Down
8 changes: 4 additions & 4 deletions packages/aws-cdk-lib/aws-sns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const topicPolicy = new sns.TopicPolicy(this, 'Policy', {

### Enforce encryption of data in transit when publishing to a topic

You can enforce SSL when creating a topic policy by setting the `enforceSsl` flag:
You can enforce SSL when creating a topic policy by setting the `enforceSSL` flag:

```ts
const topic = new sns.Topic(this, 'Topic');
Expand All @@ -228,11 +228,11 @@ const policyDocument = new iam.PolicyDocument({
const topicPolicy = new sns.TopicPolicy(this, 'Policy', {
topics: [topic],
policyDocument,
enforceSsl: true,
enforceSSL: true,
});
```

Similiarly for `addToResourcePolicy`, you can enforce SSL by setting the `enforceSsl` flag:
Similiarly for `addToResourcePolicy`, you can enforce SSL by setting the `enforceSSL` flag:

```ts
const topic = new sns.Topic(this, 'TopicAddPolicy');
Expand All @@ -242,7 +242,7 @@ topic.addToResourcePolicy(new iam.PolicyStatement({
actions: ['sns:Publish'],
resources: [topic.topicArn],
}), {
enforceSsl: true,
enforceSSL: true,
});
```

Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-sns/lib/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class TopicPolicy extends Resource {
this.document = props.policyDocument ?? this.document;

if (props.enforceSSL) {
props.topics.map(t => this.document.addStatements(this.createSslPolicyDocument(t.topicArn)));
props.topics.map(t => this.document.addStatements(this.createSSLPolicyDocument(t.topicArn)));
}

new CfnTopicPolicy(this, 'Resource', {
Expand All @@ -75,7 +75,7 @@ export class TopicPolicy extends Resource {
*
* For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
*/
protected createSslPolicyDocument(topicArn: string): PolicyStatement {
protected createSSLPolicyDocument(topicArn: string): PolicyStatement {
return new PolicyStatement ({
sid: 'AllowPublishThroughSSLOnly',
actions: ['sns:Publish'],
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-sns/lib/topic-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export abstract class TopicBase extends Resource implements ITopic {
this.policy.document.addStatements(statement);

if (addToResourcePolicyProps?.enforceSSL) {
this.policy.document.addStatements(this.createSslPolicyDocument());
this.policy.document.addStatements(this.createSSLPolicyDocument());
}
return { statementAdded: true, policyDependable: this.policy };
}
Expand All @@ -160,7 +160,7 @@ export abstract class TopicBase extends Resource implements ITopic {
*
* For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
*/
protected createSslPolicyDocument(): iam.PolicyStatement {
protected createSSLPolicyDocument(): iam.PolicyStatement {
return new iam.PolicyStatement ({
sid: 'AllowPublishThroughSSLOnly',
actions: ['sns:Publish'],
Expand Down

0 comments on commit d1b1fb6

Please sign in to comment.