Skip to content

Commit e017f09

Browse files
authored
Merge pull request #2079 from udondan/iam-updates
2 parents dc486eb + ce7f64a commit e017f09

17 files changed

Lines changed: 187 additions & 13 deletions

CHANGELOG/v0.784.0.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**New services:**
2+
3+
- application-signals-mcp
4+
5+
**New actions:**
6+
7+
- cloudwatch:CallWithBearerToken
8+
- securityhub:GenerateRecommendedPolicyV2
9+
- securityhub:GetRecommendedPolicyV2
10+
- securityhub:GetUsageV2
11+
- securityhub:ListAccountUsageV2

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
<!-- stats -->
1616
Support for:
1717

18-
- 448 Services
19-
- 20740 Actions
20-
- 2208 Resource Types
21-
- 2336 Condition keys
18+
- 449 Services
19+
- 20747 Actions
20+
- 2209 Resource Types
21+
- 2337 Condition keys
2222
<!-- /stats -->
2323

2424
![EXPERIMENTAL](https://img.shields.io/badge/stability-experimantal-orange?style=for-the-badge)**<br>This is an early version of the package. The API will change while I implement new features. Therefore make sure you use an exact version in your `package.json` before it reaches 1.0.0.**

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.783.0
1+
0.784.0

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author = 'Daniel Schroeder'
2525

2626
# The full version, including alpha/beta/rc tags
27-
release = '0.783.0'
27+
release = '0.784.0'
2828

2929
# -- General configuration ---------------------------------------------------
3030

docs/source/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ AWS IAM policy statement generator with fluent interface.
3030
3131
Support for:
3232

33-
- 448 Services
34-
- 20740 Actions
35-
- 2208 Resource Types
36-
- 2336 Condition keys
33+
- 449 Services
34+
- 20747 Actions
35+
- 2209 Resource Types
36+
- 2337 Condition keys
3737

3838
..
3939
/stats

lib/generated/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export { Cloudsearch } from './policy-statements/cloudsearch';
2222
export { Cloudwatch } from './policy-statements/cloudwatch';
2323
export { Applicationinsights } from './policy-statements/cloudwatchapplicationinsights';
2424
export { ApplicationSignals } from './policy-statements/cloudwatchapplicationsignals';
25+
export { ApplicationSignalsMcp } from './policy-statements/cloudwatchapplicationsignalsmcpserver';
2526
export { Evidently } from './policy-statements/cloudwatchevidently';
2627
export { Internetmonitor } from './policy-statements/cloudwatchinternetmonitor';
2728
export { Logs } from './policy-statements/cloudwatchlogs';

lib/generated/policy-statements/cloudwatch.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ export class Cloudwatch extends PolicyStatement {
4040
return this.to('BatchGetServiceLevelObjectiveBudgetReport');
4141
}
4242

43+
/**
44+
* Grants permission to make API calls to CloudWatch using bearer token authentication
45+
*
46+
* Access Level: Write
47+
*
48+
* https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/permissions-reference-cw.html
49+
*/
50+
public toCallWithBearerToken() {
51+
return this.to('CallWithBearerToken');
52+
}
53+
4354
/**
4455
* Grants permission to create a service level objective
4556
*
@@ -569,6 +580,10 @@ export class Cloudwatch extends PolicyStatement {
569580
*
570581
* Access Level: Write
571582
*
583+
* Possible conditions:
584+
* - .ifAwsRequestTag()
585+
* - .ifAwsTagKeys()
586+
*
572587
* https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutDashboard.html
573588
*/
574589
public toPutDashboard() {
@@ -774,6 +789,7 @@ export class Cloudwatch extends PolicyStatement {
774789
'ListManagedInsightRules'
775790
],
776791
Write: [
792+
'CallWithBearerToken',
777793
'CreateServiceLevelObjective',
778794
'DeleteAlarmMuteRule',
779795
'DeleteAlarms',
@@ -862,6 +878,9 @@ export class Cloudwatch extends PolicyStatement {
862878
* @param dashboardName - Identifier for the dashboardName.
863879
* @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account.
864880
* @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition.
881+
*
882+
* Possible conditions:
883+
* - .ifAwsResourceTag()
865884
*/
866885
public onDashboard(dashboardName: string, account?: string, partition?: string) {
867886
return this.on(`arn:${ partition ?? this.defaultPartition }:cloudwatch::${ account ?? this.defaultAccount }:dashboard/${ dashboardName }`);
@@ -946,6 +965,7 @@ export class Cloudwatch extends PolicyStatement {
946965
* - .toListManagedInsightRules()
947966
* - .toPutAlarmMuteRule()
948967
* - .toPutCompositeAlarm()
968+
* - .toPutDashboard()
949969
* - .toPutInsightRule()
950970
* - .toPutManagedInsightRules()
951971
* - .toPutMetricAlarm()
@@ -968,6 +988,7 @@ export class Cloudwatch extends PolicyStatement {
968988
* Applies to resource types:
969989
* - alarm
970990
* - alarm-mute-rule
991+
* - dashboard
971992
* - insight-rule
972993
* - metric-stream
973994
* - slo
@@ -991,6 +1012,7 @@ export class Cloudwatch extends PolicyStatement {
9911012
* - .toListManagedInsightRules()
9921013
* - .toPutAlarmMuteRule()
9931014
* - .toPutCompositeAlarm()
1015+
* - .toPutDashboard()
9941016
* - .toPutInsightRule()
9951017
* - .toPutManagedInsightRules()
9961018
* - .toPutMetricAlarm()
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import { AccessLevelList } from '../../shared/access-level';
2+
import { PolicyStatement, Operator } from '../../shared';
3+
4+
/**
5+
* Statement provider for service [application-signals-mcp](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoncloudwatchapplicationsignalsmcpserver.html).
6+
*
7+
* @param sid [SID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html) of the statement
8+
*/
9+
export class ApplicationSignalsMcp extends PolicyStatement {
10+
public servicePrefix = 'application-signals-mcp';
11+
12+
/**
13+
* Statement provider for service [application-signals-mcp](https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoncloudwatchapplicationsignalsmcpserver.html).
14+
*
15+
* @param sid [SID](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html) of the statement
16+
*/
17+
constructor(sid?: string) {
18+
super(sid);
19+
}
20+
21+
/**
22+
* Grants permission to invoke read-only Application Signals MCP tools (list_monitored_services, get_service_detail, query_service_metrics, list_service_operations, get_slo, list_slos, search_transaction_spans, query_sampled_traces, list_slis, get_enablement_guide, list_change_events, list_group_services, audit_group_health, get_group_dependencies, get_group_changes, list_grouping_attribute_definitions, audit_services, audit_slos, audit_service_operations, analyze_canary_failures)
23+
*
24+
* Access Level: Read
25+
*
26+
* https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Signals.html
27+
*/
28+
public toCallReadOnlyTool() {
29+
return this.to('CallReadOnlyTool');
30+
}
31+
32+
/**
33+
* Grants permission to connect to and interact with the Application Signals MCP server (initialize, list tools, list resources, list prompts)
34+
*
35+
* Access Level: Read
36+
*
37+
* https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Signals.html
38+
*/
39+
public toInvokeMcp() {
40+
return this.to('InvokeMcp');
41+
}
42+
43+
protected accessLevelList: AccessLevelList = {
44+
Read: [
45+
'CallReadOnlyTool',
46+
'InvokeMcp'
47+
]
48+
};
49+
50+
/**
51+
* Adds a resource of type mcp-server to the statement
52+
*
53+
* https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Signals.html
54+
*
55+
* @param resourceName - Identifier for the resourceName.
56+
* @param account - Account of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's account.
57+
* @param region - Region of the resource; defaults to `*`, unless using the CDK, where the default is the current Stack's region.
58+
* @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition.
59+
*
60+
* Possible conditions:
61+
* - .ifAwsResourceTag()
62+
*/
63+
public onMcpServer(resourceName: string, account?: string, region?: string, partition?: string) {
64+
return this.on(`arn:${ partition ?? this.defaultPartition }:application-signals-mcp:${ region ?? this.defaultRegion }:${ account ?? this.defaultAccount }:mcp-server/${ resourceName }`);
65+
}
66+
67+
/**
68+
* Filters access by tag key-value pairs attached to the resource
69+
*
70+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag
71+
*
72+
* Applies to resource types:
73+
* - mcp-server
74+
*
75+
* @param tagKey The tag key to check
76+
* @param value The value(s) to check
77+
* @param operator Works with [string operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html#Conditions_String). **Default:** `StringLike`
78+
*/
79+
public ifAwsResourceTag(tagKey: string, value: string | string[], operator?: Operator | string) {
80+
return this.if(`aws:ResourceTag/${ tagKey }`, value, operator ?? 'StringLike');
81+
}
82+
}

lib/generated/policy-statements/devopsagentservice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ export class Aidevops extends PolicyStatement {
795795
* @param partition - Partition of the AWS account [aws, aws-cn, aws-us-gov]; defaults to `aws`, unless using the CDK, where the default is the current Stack's partition.
796796
*/
797797
public onAssociations(agentSpaceId: string, associationId: string, account?: string, region?: string, partition?: string) {
798-
return this.on(`arn:${ partition ?? this.defaultPartition }:aidevops:${ region ?? this.defaultRegion }:${ account ?? this.defaultAccount }:agentspace/${ agentSpaceId }/associations/${ associationId }`);
798+
return this.on(`arn:${ partition ?? this.defaultPartition }:aidevops:${ region ?? this.defaultRegion }:${ account ?? this.defaultAccount }:agentspace/${ agentSpaceId }/association/${ associationId }`);
799799
}
800800

801801
/**

lib/generated/policy-statements/redshift.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class Redshift extends PolicyStatement {
9393
}
9494

9595
/**
96-
* Grants permission to Amazon Redshift to continuously validate that the target data warehouse can receive data replicated from the source ARN
96+
* Grants permission to Amazon Redshift to continuously validate that the target namespace can receive data replicated from the source ARN
9797
*
9898
* Access Level: Write
9999
*
@@ -369,7 +369,7 @@ export class Redshift extends PolicyStatement {
369369
}
370370

371371
/**
372-
* Grants permission to the source principal to create an inbound integration for data to be replicated from the source into the target data warehouse
372+
* Grants permission to the source principal to create an integration into the namespace of target data warehouse
373373
*
374374
* Access Level: Write
375375
*

0 commit comments

Comments
 (0)