Skip to content

Commit 83cc751

Browse files
committed
wtf?
1 parent c672448 commit 83cc751

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

packages/aws-cdk-lib/aws-cloudfront/lib/cache-policy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ export class CachePolicy extends Resource implements ICachePolicy {
161161
public readonly cachePolicyRef = {
162162
cachePolicyId: managedCachePolicyId,
163163
};
164+
165+
public with(): this {
166+
throw new UnscopedValidationError('The result of fromManagedCachePolicy can not be used in this API');
167+
}
164168
}();
165169
}
166170

packages/aws-cdk-lib/aws-cloudfront/lib/origin-request-policy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ export class OriginRequestPolicy extends Resource implements IOriginRequestPolic
100100
public readonly originRequestPolicyRef = {
101101
originRequestPolicyId: managedOriginRequestPolicyId,
102102
};
103+
104+
public with(): this {
105+
throw new UnscopedValidationError('The result of fromManagedOriginRequestPolicy can not be used in this API');
106+
}
103107
}();
104108
}
105109

packages/aws-cdk-lib/aws-cloudfront/lib/response-headers-policy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ export class ResponseHeadersPolicy extends Resource implements IResponseHeadersP
122122
public readonly responseHeadersPolicyRef = {
123123
responseHeadersPolicyId: managedResponseHeadersPolicyId,
124124
};
125+
126+
public with(): this {
127+
throw new UnscopedValidationError('The result of fromManagedResponseHeadersPolicy can not be used in this API');
128+
}
125129
};
126130
}
127131

packages/aws-cdk-lib/aws-codepipeline-actions/lib/elastic-beanstalk/deploy-action.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Construct, Node } from 'constructs';
22
import * as codepipeline from '../../../aws-codepipeline';
3+
import { IManagedPolicy } from '../../../aws-iam';
34
import { Aws, ResourceEnvironment, UnscopedValidationError } from '../../../core';
45
import { Action } from '../action';
56
import { deployArtifactBounds } from '../common';
@@ -62,6 +63,9 @@ export class ElasticBeanstalkDeployAction extends Action {
6263
},
6364
managedPolicyArn: policyArn,
6465
managedPolicyRef: { policyArn },
66+
with(): IManagedPolicy {
67+
throw new UnscopedValidationError('This object can not be used in this API');
68+
},
6569
});
6670

6771
// the Action's Role needs to read from the Bucket to get artifacts

packages/aws-cdk-lib/aws-iam/lib/managed-policy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ export class ManagedPolicy extends Resource implements IManagedPolicy, IGrantabl
199199
public get env(): ResourceEnvironment {
200200
throw new UnscopedValidationError('The result of fromAwsManagedPolicyName can not be used in this API');
201201
}
202+
public with(): this {
203+
throw new UnscopedValidationError('The result of fromAwsManagedPolicyName can not be used in this API');
204+
}
202205
}
203206
return new AwsManagedPolicy();
204207
}

0 commit comments

Comments
 (0)