Skip to content

Commit

Permalink
Add CloudWatchFullAccessV2 managed policy (#2913) (#2978)
Browse files Browse the repository at this point in the history
Signed-off-by: Justin CT Liu <[email protected]>
Co-authored-by: Ian Wahbe <[email protected]>
  • Loading branch information
JustinTW and iwahbe authored Nov 21, 2023
1 parent 71af455 commit 165cbee
Show file tree
Hide file tree
Showing 10 changed files with 127 additions and 100 deletions.
7 changes: 6 additions & 1 deletion provider/cmd/pulumi-resource-aws/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64368,7 +64368,12 @@
},
{
"name": "CloudWatchFullAccess",
"value": "arn:aws:iam::aws:policy/CloudWatchFullAccess"
"value": "arn:aws:iam::aws:policy/CloudWatchFullAccess",
"deprecationMessage": "This policy is deprecated and will no longer be supported by AWS after December 7, 2023. Use CloudWatchFullAccessV2 instead."
},
{
"name": "CloudWatchFullAccessV2",
"value": "arn:aws:iam::aws:policy/CloudWatchFullAccessV2"
},
{
"name": "CloudWatchInternetMonitorServiceRolePolicy",
Expand Down
7 changes: 6 additions & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -5672,7 +5672,12 @@ $ pulumi import aws:networkfirewall/resourcePolicy:ResourcePolicy example arn:aw
{Name: "CloudWatchEventsInvocationAccess", Value: "arn:aws:iam::aws:policy/service-role/CloudWatchEventsInvocationAccess"},
{Name: "CloudWatchEventsReadOnlyAccess", Value: "arn:aws:iam::aws:policy/CloudWatchEventsReadOnlyAccess"},
{Name: "CloudWatchEventsServiceRolePolicy", Value: "arn:aws:iam::aws:policy/aws-service-role/CloudWatchEventsServiceRolePolicy"},
{Name: "CloudWatchFullAccess", Value: "arn:aws:iam::aws:policy/CloudWatchFullAccess"},
{
Name: "CloudWatchFullAccess",
Value: "arn:aws:iam::aws:policy/CloudWatchFullAccess",
DeprecationMessage: "This policy is deprecated and will no longer be supported by AWS after December 7, 2023. Use CloudWatchFullAccessV2 instead.",
},
{Name: "CloudWatchFullAccessV2", Value: "arn:aws:iam::aws:policy/CloudWatchFullAccessV2"},
{Name: "CloudWatchInternetMonitorServiceRolePolicy", Value: "arn:aws:iam::aws:policy/aws-service-role/CloudWatchInternetMonitorServiceRolePolicy"},
{Name: "CloudWatchLambdaInsightsExecutionRolePolicy", Value: "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy"},
{Name: "CloudWatchLogsCrossAccountSharingConfiguration", Value: "arn:aws:iam::aws:policy/CloudWatchLogsCrossAccountSharingConfiguration"},
Expand Down
2 changes: 2 additions & 0 deletions sdk/dotnet/Iam/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,9 @@ private ManagedPolicy(string value)
public static ManagedPolicy CloudWatchEventsInvocationAccess { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/service-role/CloudWatchEventsInvocationAccess");
public static ManagedPolicy CloudWatchEventsReadOnlyAccess { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/CloudWatchEventsReadOnlyAccess");
public static ManagedPolicy CloudWatchEventsServiceRolePolicy { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/aws-service-role/CloudWatchEventsServiceRolePolicy");
[Obsolete(@"This policy is deprecated and will no longer be supported by AWS after December 7, 2023. Use CloudWatchFullAccessV2 instead.")]
public static ManagedPolicy CloudWatchFullAccess { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/CloudWatchFullAccess");
public static ManagedPolicy CloudWatchFullAccessV2 { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/CloudWatchFullAccessV2");
public static ManagedPolicy CloudWatchInternetMonitorServiceRolePolicy { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/aws-service-role/CloudWatchInternetMonitorServiceRolePolicy");
public static ManagedPolicy CloudWatchLambdaInsightsExecutionRolePolicy { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy");
public static ManagedPolicy CloudWatchLogsCrossAccountSharingConfiguration { get; } = new ManagedPolicy("arn:aws:iam::aws:policy/CloudWatchLogsCrossAccountSharingConfiguration");
Expand Down
188 changes: 95 additions & 93 deletions sdk/go/aws/iam/pulumiEnums.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,13 @@ public enum ManagedPolicy {
CloudWatchEventsInvocationAccess("arn:aws:iam::aws:policy/service-role/CloudWatchEventsInvocationAccess"),
CloudWatchEventsReadOnlyAccess("arn:aws:iam::aws:policy/CloudWatchEventsReadOnlyAccess"),
CloudWatchEventsServiceRolePolicy("arn:aws:iam::aws:policy/aws-service-role/CloudWatchEventsServiceRolePolicy"),
/**
* @deprecated
* This policy is deprecated and will no longer be supported by AWS after December 7, 2023. Use CloudWatchFullAccessV2 instead.
*/
@Deprecated /* This policy is deprecated and will no longer be supported by AWS after December 7, 2023. Use CloudWatchFullAccessV2 instead. */
CloudWatchFullAccess("arn:aws:iam::aws:policy/CloudWatchFullAccess"),
CloudWatchFullAccessV2("arn:aws:iam::aws:policy/CloudWatchFullAccessV2"),
CloudWatchInternetMonitorServiceRolePolicy("arn:aws:iam::aws:policy/aws-service-role/CloudWatchInternetMonitorServiceRolePolicy"),
CloudWatchLambdaInsightsExecutionRolePolicy("arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy"),
CloudWatchLogsCrossAccountSharingConfiguration("arn:aws:iam::aws:policy/CloudWatchLogsCrossAccountSharingConfiguration"),
Expand Down
4 changes: 3 additions & 1 deletion sdk/nodejs/iam/managedPolicies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,10 @@ export module ManagedPolicies {
export const CloudWatchEventsInvocationAccess: ARN = "arn:aws:iam::aws:policy/service-role/CloudWatchEventsInvocationAccess";
/** Use ManagedPolicy.CloudWatchEventsReadOnlyAccess instead. */
export const CloudWatchEventsReadOnlyAccess: ARN = "arn:aws:iam::aws:policy/CloudWatchEventsReadOnlyAccess";
/** Use ManagedPolicy.CloudWatchFullAccess instead. */
/** @deprecated This policy is deprecated and will no longer be supported after December 7, 2023. Use ManagedPolicy.CloudWatchFullAccessV2 instead. */
export const CloudWatchFullAccess: ARN = "arn:aws:iam::aws:policy/CloudWatchFullAccess";
/** Use ManagedPolicy.CloudWatchFullAccessV2 instead. */
export const CloudWatchFullAccessV2: ARN = "arn:aws:iam::aws:policy/CloudWatchFullAccessV2";
/** Use ManagedPolicy.CloudWatchLogsFullAccess instead. */
export const CloudWatchLogsFullAccess: ARN = "arn:aws:iam::aws:policy/CloudWatchLogsFullAccess";
/** Use ManagedPolicy.CloudWatchLogsReadOnlyAccess instead. */
Expand Down
4 changes: 2 additions & 2 deletions sdk/nodejs/kinesis/kinesisMixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface StreamEventSubscriptionArgs {
* * `ReportBatchItemFailures`
*/
readonly functionResponseTypes?: string[];

/**
* The maximum amount of time to gather records before invoking the function, in seconds. Records will continue to buffer
* until either maximum_batching_window_in_seconds expires or batch_size has been met. Defaults to as soon as records
Expand Down Expand Up @@ -163,7 +163,7 @@ function createFunctionFromEventHandler(
policies: [
iam.ManagedPolicy.AWSLambdaKinesisExecutionRole,
iam.ManagedPolicy.AmazonKinesisFullAccess,
iam.ManagedPolicy.CloudWatchFullAccess,
iam.ManagedPolicy.CloudWatchFullAccessV2,
iam.ManagedPolicy.CloudWatchEventsFullAccess,
iam.ManagedPolicy.LambdaFullAccess,
],
Expand Down
4 changes: 2 additions & 2 deletions sdk/nodejs/lambda/lambdaMixins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export function createFunctionFromEventHandler<E, R>(
* details on this process.
* If no IAM Role is specified, CallbackFunction will automatically use the following managed policies:
* `AWSLambda_FullAccess`
* `CloudWatchFullAccess`
* `CloudWatchFullAccessV2`
* `CloudWatchEventsFullAccess`
* `AmazonS3FullAccess`
* `AmazonDynamoDBFullAccess`
Expand Down Expand Up @@ -313,7 +313,7 @@ export class CallbackFunction<E, R> extends LambdaFunction {

if (!args.policies) {

const policies = [iam.ManagedPolicy.LambdaFullAccess, iam.ManagedPolicy.CloudWatchFullAccess,
const policies = [iam.ManagedPolicy.LambdaFullAccess, iam.ManagedPolicy.CloudWatchFullAccessV2,
iam.ManagedPolicy.CloudWatchEventsFullAccess, iam.ManagedPolicy.AmazonS3FullAccess,
iam.ManagedPolicy.AmazonDynamoDBFullAccess, iam.ManagedPolicy.AmazonSQSFullAccess,
iam.ManagedPolicy.AmazonKinesisFullAccess, iam.ManagedPolicy.AmazonCognitoPowerUser,
Expand Down
4 changes: 4 additions & 0 deletions sdk/nodejs/types/enums/iam/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,11 @@ export const ManagedPolicy = {
CloudWatchEventsInvocationAccess: "arn:aws:iam::aws:policy/service-role/CloudWatchEventsInvocationAccess",
CloudWatchEventsReadOnlyAccess: "arn:aws:iam::aws:policy/CloudWatchEventsReadOnlyAccess",
CloudWatchEventsServiceRolePolicy: "arn:aws:iam::aws:policy/aws-service-role/CloudWatchEventsServiceRolePolicy",
/**
* @deprecated This policy is deprecated and will no longer be supported by AWS after December 7, 2023. Use CloudWatchFullAccessV2 instead.
*/
CloudWatchFullAccess: "arn:aws:iam::aws:policy/CloudWatchFullAccess",
CloudWatchFullAccessV2: "arn:aws:iam::aws:policy/CloudWatchFullAccessV2",
CloudWatchInternetMonitorServiceRolePolicy: "arn:aws:iam::aws:policy/aws-service-role/CloudWatchInternetMonitorServiceRolePolicy",
CloudWatchLambdaInsightsExecutionRolePolicy: "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy",
CloudWatchLogsCrossAccountSharingConfiguration: "arn:aws:iam::aws:policy/CloudWatchLogsCrossAccountSharingConfiguration",
Expand Down
1 change: 1 addition & 0 deletions sdk/python/pulumi_aws/iam/_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ class ManagedPolicy(str, Enum):
CLOUD_WATCH_EVENTS_READ_ONLY_ACCESS = "arn:aws:iam::aws:policy/CloudWatchEventsReadOnlyAccess"
CLOUD_WATCH_EVENTS_SERVICE_ROLE_POLICY = "arn:aws:iam::aws:policy/aws-service-role/CloudWatchEventsServiceRolePolicy"
CLOUD_WATCH_FULL_ACCESS = "arn:aws:iam::aws:policy/CloudWatchFullAccess"
CLOUD_WATCH_FULL_ACCESS_V2 = "arn:aws:iam::aws:policy/CloudWatchFullAccessV2"
CLOUD_WATCH_INTERNET_MONITOR_SERVICE_ROLE_POLICY = "arn:aws:iam::aws:policy/aws-service-role/CloudWatchInternetMonitorServiceRolePolicy"
CLOUD_WATCH_LAMBDA_INSIGHTS_EXECUTION_ROLE_POLICY = "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy"
CLOUD_WATCH_LOGS_CROSS_ACCOUNT_SHARING_CONFIGURATION = "arn:aws:iam::aws:policy/CloudWatchLogsCrossAccountSharingConfiguration"
Expand Down

0 comments on commit 165cbee

Please sign in to comment.