-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support for AgentPermissions in CloudFormation (Schema + CreateHandler) #10
Changes from 2 commits
1f35702
47d8e94
df79639
c8e6f63
ab7580d
1713e9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,6 +6,10 @@ | |||||
"Arn": { | ||||||
"type": "string", | ||||||
"pattern": "^arn:aws(-(cn|gov))?:[a-z-]+:(([a-z]+-)+[0-9]+):([0-9]{12}):[^.]+$" | ||||||
}, | ||||||
"ArnIam": { | ||||||
"type": "string", | ||||||
"pattern": "^arn:aws(-(cn|gov))?:iam::([0-9]{12}):[^.]+$" | ||||||
} | ||||||
}, | ||||||
"properties": { | ||||||
|
@@ -16,6 +20,33 @@ | |||||
"maxLength": 255, | ||||||
"pattern": "^[\\w-]+$" | ||||||
}, | ||||||
"Permissions": { | ||||||
"description": "The permissions attached for this profiling group.", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I will update. |
||||||
"type": "object", | ||||||
"additionalProperties": false, | ||||||
"required": [ | ||||||
"AgentPermissions" | ||||||
], | ||||||
"properties": { | ||||||
"AgentPermissions": { | ||||||
"type": "object", | ||||||
"description": "The permissions for the agent.", | ||||||
"additionalProperties": false, | ||||||
"required": [ | ||||||
"Principals" | ||||||
], | ||||||
"properties": { | ||||||
"Principals": { | ||||||
"description": "The principals for the agent permissions.", | ||||||
"type": "array", | ||||||
"items": { | ||||||
"$ref": "#/definitions/ArnIam" | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This structure seems quite deep: {
"Type": "AWS::CodeGuruProfiler::ProfilingGroup",
"Properties": {
"ProfilingGroupName": "some-profiling-group",
"Permissions": {
"AgentPermissions": {
"Principals": ["...list of principals... "]
}
}
}
} What do you think of making it a little more flatter by going with {
"Type": "AWS::CodeGuruProfiler::ProfilingGroup",
"Properties": {
"ProfilingGroupName": "some-profiling-group",
"Permissions": [
{
"ActionGroup": "agentPermissions",
"Principals": ["...list of principals..."]
}
]
}
} or {
"Type": "AWS::CodeGuruProfiler::ProfilingGroup",
"Properties": {
"ProfilingGroupName": "some-profiling-group",
"AgentPermissions": {
"Principals": ["...list of principals... "]
}
}
} ? Cloudformation is already quite verbose, so the more lightweight we can make it, the better :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I will update the code with having |
||||||
} | ||||||
}, | ||||||
"Arn": { | ||||||
"description": "The Amazon Resource Name (ARN) of the specified profiling group.", | ||||||
"$ref": "#/definitions/Arn", | ||||||
|
@@ -26,7 +57,8 @@ | |||||
}, | ||||||
"additionalProperties": false, | ||||||
"required": [ | ||||||
"ProfilingGroupName" | ||||||
"ProfilingGroupName", | ||||||
"Permissions" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems potentially problematic -- what happens to existing customers that have cloudformation written without specifying permissions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense, I will update then the code for |
||||||
], | ||||||
"primaryIdentifier": [ | ||||||
"/properties/ProfilingGroupName" | ||||||
|
@@ -40,7 +72,8 @@ | |||||
"handlers": { | ||||||
"create": { | ||||||
"permissions": [ | ||||||
"codeguru-profiler:CreateProfilingGroup" | ||||||
"codeguru-profiler:CreateProfilingGroup", | ||||||
"codeguru-profiler:PutPermission" | ||||||
] | ||||||
}, | ||||||
"read": { | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
<dependency> | ||
<groupId>software.amazon.cloudformation</groupId> | ||
<artifactId>aws-cloudformation-rpdk-java-plugin</artifactId> | ||
<version>1.0.2</version> | ||
<version>1.0.5</version> | ||
</dependency> | ||
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> | ||
<dependency> | ||
|
@@ -74,9 +74,19 @@ | |
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>codeguruprofiler</artifactId> | ||
<version>2.10.63</version> | ||
</dependency> | ||
</dependencies> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>bom</artifactId> | ||
<version>2.13.16</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be nice to see this change in a separate commit and with an explanation of what it does, so that it would be clear and we could refer to it in the future. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
<build> | ||
<plugins> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GovCloud partition is incorrect and the isolated partitions are missing in the current Arn definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into it in #19