Skip to content

Commit ddc4e7e

Browse files
authored
Merge pull request #388 from Yanis-0430/main
added marketplace agreements module
2 parents 18317cf + 357f9b7 commit ddc4e7e

File tree

11 files changed

+676
-43
lines changed

11 files changed

+676
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This repository is a part of [Cloud Intelligence Dashboards](https://docs.aws.am
2424

2525
This repository contains following elements:
2626
* [data-exports](/data-exports) - a Cloud Formation Templates for AWS Data Exports, such as Cost and Usage Report 2.0 and others. This allows a replication of Exports from your Management Account(s) to a Dedicated Data Collection Accounts as well as aggregation of multiple Exports from a set of Linked Accounts.
27-
* [data-collection](/data-collection) - a set of Cloud Formation Templates for collecting infrastructure operational data from Management and Linked Accounts. Such as data from AWS Trusted Advisor, AWS Compute Optimizer, Inventories, Pricing, AWS Health, AWS Support Cases etc. See more about types of data collected [here](/data-collection).
27+
* [data-collection](/data-collection) - a set of Cloud Formation Templates for collecting infrastructure operational data from Management and Linked Accounts. Such as data from AWS Trusted Advisor, AWS Compute Optimizer, Inventories, Pricing, AWS Health, AWS Support Cases, AWS Marketplace etc. See more about types of data collected [here](/data-collection).
2828
* [case-summarization](/case-summarization) - an additional Cloud Formation Template for deploying the AWS Support Case Summarization plugin that offers the capability to summarize cases through Generative AI powered by Amazon Bedrock.
2929
* [rls](/rls) - a stack for managing Row Level Security for CID Dashboards.
3030
* [security-hub](/security-hub) - Collection of data from AWS Security Hub.

data-collection/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ List of modules and objects collected:
4343
| `aws-feeds` | N/A | Data Collection Account | Collects Blog posts and News Feeds |
4444
| `quicksight` | [Amazon QuickSight](https://aws.amazon.com/quicksight/) | Data Collection Account | Collects QuickSight User and Group information in the Data Collection Account only |
4545
| `resilience-hub` | [AWS Resilince Hub](https://aws.amazon.com/resilience-hub/) | Linked Accounts | |
46+
| `marketplace` | [AWS Marketplace](https://aws.amazon.com/marketplace/) | Linked Accounts | Collects AWS Marketplace data and terms |
4647
| `reference` | Various services | Data Collection Account | Collects reference data for other modules and dashboard to function |
4748

4849
### Deployment Overview

data-collection/deploy/deploy-data-collection.yaml

Lines changed: 67 additions & 31 deletions
Large diffs are not rendered by default.

data-collection/deploy/deploy-data-read-permissions.yaml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# https://github.com/awslabs/cid-data-collection-framework/blob/main/data-collection/v3.13.1/deploy/deploy-data-read-permissions.yaml
1+
# https://github.com/awslabs/cid-data-collection-framework/blob/main/data-collection/v3.14.0/deploy/deploy-data-read-permissions.yaml
22
AWSTemplateFormatVersion: '2010-09-09'
3-
Description: CID Data Collection - All-in-One for Management Account v3.13.1 - AWS Solution SO9011
3+
Description: CID Data Collection - All-in-One for Management Account v3.14.0 - AWS Solution SO9011
44
Metadata:
55
AWS::CloudFormation::Interface:
66
ParameterGroups:
@@ -33,6 +33,7 @@ Metadata:
3333
- IncludeLicenseManagerModule
3434
- IncludeServiceQuotasModule
3535
- IncludeResilienceHubModule
36+
- IncludeMarketplaceModule
3637
ParameterLabels:
3738
ManagementAccountRole:
3839
default: "Management account role"
@@ -80,6 +81,8 @@ Metadata:
8081
default: "Include Service Quotas Module"
8182
IncludeResilienceHubModule:
8283
default: "Include ResilienceHub Module"
84+
IncludeMarketplaceModule:
85+
default: "Include Marketplace Agreements Module"
8386

8487
Parameters:
8588
ManagementAccountRole:
@@ -191,14 +194,19 @@ Parameters:
191194
Description: Collects Resilience Hub information
192195
AllowedValues: ['yes', 'no']
193196
Default: 'no'
197+
IncludeMarketplaceModule:
198+
Type: String
199+
Description: Collects Marketplace Agreement information
200+
AllowedValues: ['yes', 'no']
201+
Default: 'no'
194202
Conditions:
195203
DeployModuleReadInMgmt: !Equals [!Ref AllowModuleReadInMgmt, "yes"]
196204

197205
Resources:
198206
DataCollectorMgmtAccountReadStack:
199207
Type: AWS::CloudFormation::Stack
200208
Properties:
201-
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.${AWS::URLSuffix}/cfn/data-collection/v3.13.1/deploy-in-management-account.yaml"
209+
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.${AWS::URLSuffix}/cfn/data-collection/v3.14.0/deploy-in-management-account.yaml"
202210
Parameters:
203211
DataCollectionAccountID: !Ref DataCollectionAccountID
204212
ManagementAccountRole: !Ref ManagementAccountRole
@@ -215,7 +223,7 @@ Resources:
215223
Type: AWS::CloudFormation::Stack
216224
Condition: DeployModuleReadInMgmt
217225
Properties:
218-
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.${AWS::URLSuffix}/cfn/data-collection/v3.13.1/deploy-in-linked-account.yaml"
226+
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.${AWS::URLSuffix}/cfn/data-collection/v3.14.0/deploy-in-linked-account.yaml"
219227
Parameters:
220228
DataCollectionAccountID: !Ref DataCollectionAccountID
221229
MultiAccountRoleName: !Ref MultiAccountRoleName
@@ -230,11 +238,12 @@ Resources:
230238
IncludeTransitGatewayModule: !Ref IncludeTransitGatewayModule
231239
IncludeServiceQuotasModule: !Ref IncludeServiceQuotasModule
232240
IncludeResilienceHubModule: !Ref IncludeResilienceHubModule
241+
IncludeMarketplaceModule: !Ref IncludeMarketplaceModule
233242

234243
DataCollectorOrgAccountModulesReadStackSet:
235244
Type: AWS::CloudFormation::StackSet
236245
Properties:
237-
Description: "StackSet in charge of deploying read roles across organization accounts v3.13.1"
246+
Description: "StackSet in charge of deploying read roles across organization accounts v3.14.0"
238247
PermissionModel: SERVICE_MANAGED
239248
AutoDeployment:
240249
Enabled: true
@@ -272,6 +281,8 @@ Resources:
272281
ParameterValue: !Ref IncludeServiceQuotasModule
273282
- ParameterKey: IncludeResilienceHubModule
274283
ParameterValue: !Ref IncludeResilienceHubModule
284+
- ParameterKey: IncludeMarketplaceModule
285+
ParameterValue: !Ref IncludeMarketplaceModule
275286
StackInstancesGroup:
276287
- DeploymentTargets:
277288
OrganizationalUnitIds: !Split [",", !Ref OrganizationalUnitIds]
@@ -281,4 +292,4 @@ Resources:
281292
- CAPABILITY_IAM
282293
- CAPABILITY_NAMED_IAM
283294
StackSetName: !Sub "StackSet-${AWS::AccountId}-OptimizationDataRole"
284-
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.${AWS::URLSuffix}/cfn/data-collection/v3.13.1/deploy-in-linked-account.yaml"
295+
TemplateURL: !Sub "https://${CFNSourceBucket}.s3.${AWS::URLSuffix}/cfn/data-collection/v3.14.0/deploy-in-linked-account.yaml"

data-collection/deploy/deploy-in-linked-account.yaml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AWSTemplateFormatVersion: '2010-09-09'
2-
Description: CID Data Collection - Role for Linked Account v3.13.1
2+
Description: CID Data Collection - Role for Linked Account v3.14.0
33
Metadata:
44
AWS::CloudFormation::Interface:
55
ParameterGroups:
@@ -22,6 +22,7 @@ Metadata:
2222
- IncludeTransitGatewayModule
2323
- IncludeServiceQuotasModule
2424
- IncludeResilienceHubModule
25+
- IncludeMarketplaceModule
2526
ParameterLabels:
2627
DataCollectionAccountID:
2728
default: 'Data Collection Account ID'
@@ -49,6 +50,8 @@ Metadata:
4950
default: 'Include Service Quotas Module'
5051
IncludeResilienceHubModule:
5152
default: 'Include Resilience Hub Module'
53+
IncludeMarketplaceModule:
54+
default: 'Include Marketplace Agreements Module'
5255

5356
Parameters:
5457
DataCollectionAccountID:
@@ -112,6 +115,11 @@ Parameters:
112115
Description: Collects Resilience Hub data from your accounts
113116
AllowedValues: ['yes', 'no']
114117
Default: 'no'
118+
IncludeMarketplaceModule:
119+
Type: String
120+
Description: Collects Marketplace Agreement data from your accounts
121+
AllowedValues: ['yes', 'no']
122+
Default: 'no'
115123

116124
Conditions:
117125
IncludeTAModulePolicy: !Equals [!Ref IncludeTAModule, "yes"]
@@ -124,6 +132,7 @@ Conditions:
124132
IncludeTransitGatewayModulePolicy: !Equals [!Ref IncludeTransitGatewayModule, "yes"]
125133
IncludeServiceQuotasModulePolicy: !Equals [!Ref IncludeServiceQuotasModule, "yes"]
126134
IncludeResilienceHubModulePolicy: !Equals [!Ref IncludeResilienceHubModule, "yes"]
135+
IncludeMarketplaceModulePolicy: !Equals [!Ref IncludeMarketplaceModule, "yes"]
127136

128137
Outputs:
129138
LambdaRole:
@@ -155,6 +164,7 @@ Resources:
155164
- !Sub "arn:${AWS::Partition}:iam::${DataCollectionAccountID}:role/${ResourcePrefix}support-cases-LambdaRole"
156165
- !Sub "arn:${AWS::Partition}:iam::${DataCollectionAccountID}:role/${ResourcePrefix}service-quotas-LambdaRole"
157166
- !Sub "arn:${AWS::Partition}:iam::${DataCollectionAccountID}:role/${ResourcePrefix}resilience-hub-LambdaRole"
167+
- !Sub "arn:${AWS::Partition}:iam::${DataCollectionAccountID}:role/${ResourcePrefix}marketplace-LambdaRole"
158168
Path: /
159169
Metadata:
160170
cfn_nag:
@@ -465,4 +475,46 @@ Resources:
465475
cfn_nag:
466476
rules_to_suppress:
467477
- id: W12
468-
reason: "Policy is used for scanning of a wide range of resources"
478+
reason: "Policy is used for scanning of a wide range of resources"
479+
# Marketplace Agreements policy
480+
AgreementsPolicy:
481+
Type: 'AWS::IAM::Policy'
482+
Condition: IncludeMarketplaceModulePolicy
483+
Properties:
484+
PolicyName: AgreementsPolicy
485+
PolicyDocument:
486+
Version: "2012-10-17"
487+
Statement:
488+
- Effect: Allow
489+
Action:
490+
- "organizations:ListAccounts"
491+
- "organizations:DescribeOrganization"
492+
Resource: "*"
493+
- Effect: Allow
494+
Action:
495+
- "aws-marketplace:DescribeAgreement"
496+
- "aws-marketplace:DescribeEntity"
497+
- "aws-marketplace:GetAgreementTerms"
498+
- "aws-marketplace:GetProduct"
499+
- "aws-marketplace:ListAgreementCharges"
500+
- "aws-marketplace:ListEntities"
501+
- "aws-marketplace:SearchAgreements"
502+
- "aws-marketplace:SearchEntities"
503+
- "marketplace-agreement:DescribeAgreement"
504+
- "marketplace-agreement:GetAgreementTerms"
505+
- "marketplace-agreement:ListAgreementCharges"
506+
- "marketplace-agreement:SearchAgreements"
507+
Resource: "*"
508+
Roles:
509+
- Ref: LambdaRole
510+
Metadata:
511+
cfn_nag:
512+
rules_to_suppress:
513+
- id: W12
514+
reason: "Policy is used for scanning of a wide range of marketplace resources"
515+
- id: W3037
516+
reason: "GetProduct and SearchEntities are beta marketplace APIs not yet in cfn-lint validation"
517+
cfn-lint:
518+
config:
519+
ignore_checks:
520+
- W3037 # Beta marketplace APIs (GetProduct, SearchEntities, marketplace-agreement service) not yet in cfn-lint validation

data-collection/deploy/deploy-in-management-account.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
AWSTemplateFormatVersion: '2010-09-09'
2-
Description: CID Data Collection - Role for Management Account v3.13.1
2+
Description: CID Data Collection - Role for Management Account v3.14.0
33
Metadata:
4+
cfn-lint:
5+
config:
6+
ignore_checks:
7+
- W2001 # IncludeMarketplaceModule parameter exists for future marketplace module integration
48
AWS::CloudFormation::Interface:
59
ParameterGroups:
610
- Label:
@@ -19,6 +23,7 @@ Metadata:
1923
- IncludeRightsizingModule
2024
- IncludeLicenseManagerModule
2125
- IncludeServiceQuotasModule
26+
- IncludeMarketplaceModule
2227
ParameterLabels:
2328
ManagementAccountRole:
2429
default: "Management account role"
@@ -40,6 +45,8 @@ Metadata:
4045
default: "Include Marketplace Licensing Module"
4146
IncludeServiceQuotasModule:
4247
default: "Include Service Quotas Module"
48+
IncludeMarketplaceModule:
49+
default: "Include Marketplace Agreements Module"
4350
Parameters:
4451
DataCollectionAccountID:
4552
Type: String
@@ -87,6 +94,11 @@ Parameters:
8794
Description: Collects Service Quotas Information from your accounts
8895
AllowedValues: ['yes', 'no']
8996
Default: 'no'
97+
IncludeMarketplaceModule:
98+
Type: String
99+
Description: Collects Marketplace Agreement Information from your accounts
100+
AllowedValues: ['yes', 'no']
101+
Default: 'no'
90102

91103
Conditions:
92104
EnableComputeOptimizerModule: !Equals [!Ref IncludeComputeOptimizerModule, "yes"]
@@ -96,6 +108,7 @@ Conditions:
96108
EnableHealthEventsModule: !Equals [!Ref IncludeHealthEventsModule, "yes"]
97109
EnableLicenseManagerModule: !Equals [!Ref IncludeLicenseManagerModule, "yes"]
98110
EnableServiceQuotasModule: !Equals [!Ref IncludeServiceQuotasModule, "yes"]
111+
# EnableMarketplaceModule: !Equals [!Ref IncludeMarketplaceModule, "yes"] # Currently unused
99112

100113
Outputs:
101114
LambdaRole:

0 commit comments

Comments
 (0)