-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add crn parser submodule #2
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
Changes from all commits
8e61400
5fa681d
1afbb6a
b061030
74796b3
855fa10
4086caa
4444d6c
2747518
c10e131
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Primary owner should be listed first in list of global owners, followed by any secondary owners | ||
* @SirSpidey @ocofaigh | ||
* @MatthewLemmond @toddgiguere |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# More info about this file at https://github.com/terraform-ibm-modules/common-pipeline-assets/blob/main/.github/workflows/terraform-test-pipeline.md#cra-config-yaml | ||
version: "v1" | ||
CRA_TARGETS: | ||
- CRA_TARGET: "examples/advanced" # Target directory for CRA scan. If not provided, the CRA Scan will not be run. | ||
- CRA_TARGET: "examples/crn-parser" # Target directory for CRA scan. If not provided, the CRA Scan will not be run. | ||
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" # CRA Ignore file to use. If not provided, it checks the repo root directory for `cra-tf-validate-ignore-rules.json` | ||
PROFILE_ID: "0e6e7b5a-817d-4344-ab6f-e5d7a9c49520" # SCC profile ID (currently set to the FSCloud 1.4.0 profile). | ||
# SCC_INSTANCE_ID: "" # The SCC instance ID to use to download profile for CRA scan. If not provided, a default global value will be used. | ||
# SCC_REGION: "" # The IBM Cloud region that the SCC instance is in. If not provided, a default global value will be used. | ||
# CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs. | ||
# TF_VAR_sample: "sample value" | ||
CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs. | ||
TF_VAR_crn: "crn:version:cname:ctype:service-name:location:scope:service-instance:resource-type:resource" | ||
# TF_VAR_other: "another value" |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# CRN parser example | ||
|
||
This example takes a CRN as the input. The outputs are the segments of the CRN that are parsed by using the CRN parser utility. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
######################################################################################################################## | ||
# Outputs | ||
# CRN Parser | ||
######################################################################################################################## | ||
|
||
#output "myoutput" { | ||
# description = "Description of my output" | ||
# value = "value" | ||
#} | ||
module "crn_parser" { | ||
source = "../../modules/crn-parser" | ||
crn = var.crn | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
######################################################################################################################## | ||
# Outputs | ||
######################################################################################################################## | ||
|
||
output "parsed_crn_ctype" { | ||
value = module.crn_parser.ctype | ||
description = "The parsed `ctype` field of the Key Protect instance CRN" | ||
} | ||
|
||
output "parsed_crn_service_name" { | ||
value = module.crn_parser.service_name | ||
description = "The parsed `service_name` field of the Key Protect instance CRN" | ||
} | ||
|
||
output "parsed_crn_region" { | ||
value = module.crn_parser.region | ||
description = "The parsed `region` field of the Key Protect instance CRN" | ||
} | ||
|
||
output "parsed_crn_scope" { | ||
value = module.crn_parser.scope | ||
description = "The parsed `scope` field of the Key Protect instance CRN" | ||
} | ||
|
||
output "parsed_crn_service_instance" { | ||
value = module.crn_parser.service_instance | ||
description = "The parsed `service_instance` field of the Key Protect instance CRN" | ||
} | ||
|
||
output "parsed_crn_resource_type" { | ||
value = module.crn_parser.resource_type | ||
description = "The parsed `resource_type` field of the Key Protect instance CRN" | ||
} | ||
|
||
output "parsed_crn_resource" { | ||
value = module.crn_parser.resource | ||
description = "The parsed `resource` field of the Key Protect instance CRN" | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
######################################################################################################################## | ||
# Provider config | ||
######################################################################################################################## | ||
|
||
provider "ibm" { | ||
ibmcloud_api_key = var.ibmcloud_api_key | ||
region = var.region | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
######################################################################################################################## | ||
# Input variables | ||
######################################################################################################################## | ||
|
||
variable "crn" { | ||
type = string | ||
description = "The CRN to parse." | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
terraform { | ||
required_version = ">= 1.3.0" | ||
} |
Uh oh!
There was an error while loading. Please reload this page.