Skip to content

Commit

Permalink
Update aws generator to use bicep-types and new contract (#40)
Browse files Browse the repository at this point in the history
* updating aws generator to use bicep-types and new contract

---------
Signed-off-by: sk593 <[email protected]>
  • Loading branch information
sk593 authored Jun 24, 2024
1 parent 5ecceca commit 7646c2d
Show file tree
Hide file tree
Showing 1,288 changed files with 325,217 additions and 29,863 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/generate-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Init bicep-types submodule
run: |
git submodule update --init --recursive
- name: Build bicep-types
run: |
pushd ./bicep-types/src/bicep-types
npm ci
npm run build
popd
- name: Download AWS types
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bicep-types"]
path = bicep-types
url = https://github.com/Azure/bicep-types
235 changes: 234 additions & 1 deletion artifacts/bicep/aws/aws.accessanalyzer/default/types.json
Original file line number Diff line number Diff line change
@@ -1 +1,234 @@
[{"1":{"Kind":1}},{"1":{"Kind":2}},{"1":{"Kind":3}},{"1":{"Kind":4}},{"1":{"Kind":5}},{"1":{"Kind":6}},{"1":{"Kind":7}},{"1":{"Kind":8}},{"2":{"Name":"ArchiveRule","Properties":{"Filter":{"Type":12,"Flags":1},"RuleName":{"Type":4,"Flags":1,"Description":"The archive rule name"}}}},{"2":{"Name":"Filter","Properties":{"Contains":{"Type":13,"Flags":0},"Eq":{"Type":14,"Flags":0},"Exists":{"Type":2,"Flags":0},"Neq":{"Type":15,"Flags":0},"Property":{"Type":4,"Flags":1}}}},{"2":{"Name":"Tag","Properties":{"Key":{"Type":4,"Flags":1,"Description":"The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. "},"Value":{"Type":4,"Flags":1,"Description":"The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. "}}}},{"2":{"Name":"UnusedAccessConfiguration","Properties":{"UnusedAccessAge":{"Type":3,"Flags":0,"Description":"The specified access age in days for which to generate findings for unused access. For example, if you specify 90 days, the analyzer will generate findings for IAM entities within the accounts of the selected organization for any access that hasn't been used in 90 or more days since the analyzer's last scan. You can choose a value between 1 and 180 days."}}}},{"3":{"ItemType":9}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"3":{"ItemType":4}},{"2":{"Name":"AWS.AccessAnalyzer/AnalyzerProperties","Properties":{"AnalyzerConfiguration":{"Type":17,"Flags":0,"Description":"The configuration for the analyzer"},"AnalyzerName":{"Type":4,"Flags":0,"Description":"Analyzer name"},"ArchiveRules":{"Type":18,"Flags":0},"Arn":{"Type":4,"Flags":18,"Description":"Amazon Resource Name (ARN) of the analyzer"},"Tags":{"Type":19,"Flags":0,"Description":"An array of key-value pairs to apply to this resource."},"Type":{"Type":4,"Flags":1,"Description":"The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or ORGANIZATION_UNUSED_ACCESS"}}}},{"2":{"Name":"Analyzer_AnalyzerConfiguration","Properties":{"UnusedAccessConfiguration":{"Type":11,"Flags":0}}}},{"3":{"ItemType":8}},{"3":{"ItemType":10}},{"2":{"Name":"AWS.AccessAnalyzer/Analyzer","Properties":{"name":{"Type":4,"Flags":0,"Description":"the resource name"},"alias":{"Type":4,"Flags":1,"Description":"the resource alias"},"properties":{"Type":16,"Flags":1,"Description":"properties of the resource"}}}},{"4":{"Name":"AWS.AccessAnalyzer/Analyzer@default","ScopeType":0,"Body":20}}]
[
{
"$type": "ObjectType",
"name": "ArchiveRule",
"properties": {
"Filter": {
"type": {
"$ref": "#/4"
},
"flags": 1
},
"RuleName": {
"type": {
"$ref": "#/5"
},
"flags": 1,
"description": "The archive rule name"
}
}
},
{
"$type": "ObjectType",
"name": "Filter",
"properties": {
"Contains": {
"type": {
"$ref": "#/6"
},
"flags": 0
},
"Eq": {
"type": {
"$ref": "#/7"
},
"flags": 0
},
"Exists": {
"type": {
"$ref": "#/8"
},
"flags": 0
},
"Neq": {
"type": {
"$ref": "#/9"
},
"flags": 0
},
"Property": {
"type": {
"$ref": "#/5"
},
"flags": 1
}
}
},
{
"$type": "ObjectType",
"name": "Tag",
"properties": {
"Key": {
"type": {
"$ref": "#/5"
},
"flags": 1,
"description": "The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. "
},
"Value": {
"type": {
"$ref": "#/5"
},
"flags": 1,
"description": "The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. "
}
}
},
{
"$type": "ObjectType",
"name": "UnusedAccessConfiguration",
"properties": {
"UnusedAccessAge": {
"type": {
"$ref": "#/10"
},
"flags": 0,
"description": "The specified access age in days for which to generate findings for unused access. For example, if you specify 90 days, the analyzer will generate findings for IAM entities within the accounts of the selected organization for any access that hasn't been used in 90 or more days since the analyzer's last scan. You can choose a value between 1 and 180 days."
}
}
},
{
"$type": "ArrayType",
"itemType": {
"$ref": "#/1"
}
},
{
"$type": "StringType"
},
{
"$type": "ArrayType",
"itemType": {
"$ref": "#/5"
}
},
{
"$type": "ArrayType",
"itemType": {
"$ref": "#/5"
}
},
{
"$type": "BooleanType"
},
{
"$type": "ArrayType",
"itemType": {
"$ref": "#/5"
}
},
{
"$type": "IntegerType"
},
{
"$type": "StringLiteralType",
"value": "AWS.AccessAnalyzer/AnalyzerProperties"
},
{
"$type": "ObjectType",
"name": "Analyzer_AnalyzerConfiguration",
"properties": {
"UnusedAccessConfiguration": {
"type": {
"$ref": "#/3"
},
"flags": 0
}
}
},
{
"$type": "ArrayType",
"itemType": {
"$ref": "#/0"
}
},
{
"$type": "ArrayType",
"itemType": {
"$ref": "#/2"
}
},
{
"$type": "ObjectType",
"name": "AWS.AccessAnalyzer/AnalyzerProperties",
"properties": {
"AnalyzerConfiguration": {
"type": {
"$ref": "#/12"
},
"flags": 0,
"description": "The configuration for the analyzer"
},
"AnalyzerName": {
"type": {
"$ref": "#/5"
},
"flags": 0,
"description": "Analyzer name"
},
"ArchiveRules": {
"type": {
"$ref": "#/13"
},
"flags": 0
},
"Arn": {
"type": {
"$ref": "#/5"
},
"flags": 18,
"description": "Amazon Resource Name (ARN) of the analyzer"
},
"Tags": {
"type": {
"$ref": "#/14"
},
"flags": 0,
"description": "An array of key-value pairs to apply to this resource."
},
"Type": {
"type": {
"$ref": "#/5"
},
"flags": 1,
"description": "The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or ORGANIZATION_UNUSED_ACCESS"
}
}
},
{
"$type": "ObjectType",
"name": "AWS.AccessAnalyzer/Analyzer",
"properties": {
"name": {
"type": {
"$ref": "#/5"
},
"flags": 0,
"description": "the resource name"
},
"alias": {
"type": {
"$ref": "#/5"
},
"flags": 17,
"description": "the resource alias"
},
"properties": {
"type": {
"$ref": "#/15"
},
"flags": 17,
"description": "properties of the resource"
}
}
},
{
"$type": "ResourceType",
"name": "AWS.AccessAnalyzer/Analyzer@default",
"scopeType": 0,
"body": {
"$ref": "#/16"
},
"flags": 0
}
]
30 changes: 15 additions & 15 deletions artifacts/bicep/aws/aws.accessanalyzer/default/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,28 @@
## Resource AWS.AccessAnalyzer/Analyzer@default
* **Valid Scope(s)**: Unknown
### Properties
* **alias**: string (Required): the resource alias
* **alias**: string (Required, Identifier): the resource alias
* **name**: string: the resource name
* **properties**: [AWS.AccessAnalyzer/AnalyzerProperties](#awsaccessanalyzeranalyzerproperties) (Required): properties of the resource

## AWS.AccessAnalyzer/AnalyzerProperties
### Properties
* **AnalyzerConfiguration**: [Analyzer_AnalyzerConfiguration](#analyzeranalyzerconfiguration): The configuration for the analyzer
* **AnalyzerName**: string: Analyzer name
* **ArchiveRules**: [ArchiveRule](#archiverule)[]
* **Arn**: string (ReadOnly, Identifier): Amazon Resource Name (ARN) of the analyzer
* **Tags**: [Tag](#tag)[]: An array of key-value pairs to apply to this resource.
* **Type**: string (Required): The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or ORGANIZATION_UNUSED_ACCESS
* **properties**: [AWS.AccessAnalyzer/AnalyzerProperties](#awsaccessanalyzeranalyzerproperties) (Required, Identifier): properties of the resource

## Analyzer_AnalyzerConfiguration
### Properties
* **UnusedAccessConfiguration**: [UnusedAccessConfiguration](#unusedaccessconfiguration)

## UnusedAccessConfiguration
### Properties
* **UnusedAccessAge**: int: The specified access age in days for which to generate findings for unused access. For example, if you specify 90 days, the analyzer will generate findings for IAM entities within the accounts of the selected organization for any access that hasn't been used in 90 or more days since the analyzer's last scan. You can choose a value between 1 and 180 days.

## ArchiveRule
### Properties
* **Filter**: [Filter](#filter)[] (Required)
* **RuleName**: string (Required): The archive rule name

## AWS.AccessAnalyzer/AnalyzerProperties
### Properties
* **AnalyzerConfiguration**: [Analyzer_AnalyzerConfiguration](#analyzeranalyzerconfiguration): The configuration for the analyzer
* **AnalyzerName**: string: Analyzer name
* **ArchiveRules**: [ArchiveRule](#archiverule)[]
* **Arn**: string (ReadOnly, Identifier): Amazon Resource Name (ARN) of the analyzer
* **Tags**: [Tag](#tag)[]: An array of key-value pairs to apply to this resource.
* **Type**: string (Required): The type of the analyzer, must be one of ACCOUNT, ORGANIZATION, ACCOUNT_UNUSED_ACCESS or ORGANIZATION_UNUSED_ACCESS

## Filter
### Properties
* **Contains**: string[]
Expand All @@ -42,3 +38,7 @@
* **Key**: string (Required): The key name of the tag. You can specify a value that is 1 to 127 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.
* **Value**: string (Required): The value for the tag. You can specify a value that is 1 to 255 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

## UnusedAccessConfiguration
### Properties
* **UnusedAccessAge**: int: The specified access age in days for which to generate findings for unused access. For example, if you specify 90 days, the analyzer will generate findings for IAM entities within the accounts of the selected organization for any access that hasn't been used in 90 or more days since the analyzer's last scan. You can choose a value between 1 and 180 days.

Loading

0 comments on commit 7646c2d

Please sign in to comment.