-
Notifications
You must be signed in to change notification settings - Fork 677
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
CBR: context-based-restriction update for Enforcement mode support #3853
Conversation
Terraform: Rule Enforcement Mode Support https://github.ibm.com/IAM/cbr-issues/issues/113
Please hold merging until PR IBM/platform-services-go-sdk#191 get merged |
Can someone review this PR? |
Type: schema.TypeString, | ||
Required: true, | ||
Description: "The ID of a rule.", | ||
}, | ||
"crn": { | ||
"id": &schema.Schema{ |
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.
Don't add "id" to the schema ..We have id for each resoure/datasource from Terraform core
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.
removed
@@ -18,42 +18,47 @@ import ( | |||
|
|||
func DataSourceIBMCbrRule() *schema.Resource { | |||
return &schema.Resource{ | |||
ReadContext: dataSourceIBMCbrRuleRead, |
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.
why were the names changed to Captial letter?
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.
These are auto-generated code from new code generator openapi-sdkgen.sh
can you please confirm with generator team to see if Capital letter names are correct.
I believe the code will be broken if I change them to lower cases.
@@ -157,7 +176,7 @@ func ResourceIBMCbrRule() *schema.Resource { | |||
} | |||
|
|||
func ResourceIBMCbrRuleValidator() *validate.ResourceValidator { | |||
validateSchema := make([]validate.ValidateSchema, 0) |
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.
can you make it 0nthe inital length...its a generator issue we posted to them
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.
change it to:
validateSchema := make([]validate.ValidateSchema, 0)
Importer: &schema.ResourceImporter{}, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"name": { | ||
"name": &schema.Schema{ | ||
Type: schema.TypeString, |
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.
why some of required were changed to optional ...Are they really optional (in all resources i have seen it)
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.
made necessary changes
Type: schema.TypeString, | ||
Computed: true, |
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.
account_id is computed or required
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.
it is required in "ref" schema
) | ||
|
||
resourceValidator := validate.ResourceValidator{ResourceName: "ibm_cbr_zone", Schema: validateSchema} | ||
return &resourceValidator | ||
} | ||
|
||
func getIBMCbrAccountId(meta interface{}) (string, error) { |
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.
why we removed this ? We added accoutn_id as optional...will this work if user doens't send account_id
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.
This is removed by code generator.
This function is not called by nowhere
@@ -2,7 +2,7 @@ | |||
layout: "ibm" | |||
page_title: "IBM : ibm_cbr_rule" | |||
description: |- | |||
Get information about cbr_rule |
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.
i thnk we shd have one tab here else subcategory will not be applicable
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.
fixed
* Constraints: The maximum length is `64` characters. The minimum length is `1` character. The value must match regular expression `^[a-zA-Z0-9]+$`. | ||
* `value` - (String) The tag attribute value. | ||
* Constraints: The maximum length is `1000` characters. The minimum length is `1` character. The value must match regular expression `^[a-zA-Z0-9 _*?.-]+$`. | ||
* `contexts` - (Required, List) The contexts this rule applies to. |
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.
A computed attributes under Attribute Reference can't have Required/optiona
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.
fixed
|
||
* `version` - Version of the cbr_rule. | ||
|
||
## Provider Configuration |
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.
Remove this section from docs ..we rasied an issue with generator team
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.
removed
@hkantare Can you please review this PR, I updated the code based on your reviews |
…3853) * CBR: Terraform Provider update for rule Enforcement-mode support Terraform: Rule Enforcement Mode Support https://github.ibm.com/IAM/cbr-issues/issues/113 * secrets.baseline update * fix import * update secrets.baseline * update platform-service-so-sdk version * Update .secrets.baseline * updated on PR review comments * Update cbr_zone.html.markdown
…BM-Cloud#3853) * CBR: Terraform Provider update for rule Enforcement-mode support Terraform: Rule Enforcement Mode Support https://github.ibm.com/IAM/cbr-issues/issues/113 * secrets.baseline update * fix import * update secrets.baseline * update platform-service-so-sdk version * Update .secrets.baseline * updated on PR review comments * Update cbr_zone.html.markdown
…BM-Cloud#3853) * CBR: Terraform Provider update for rule Enforcement-mode support Terraform: Rule Enforcement Mode Support https://github.ibm.com/IAM/cbr-issues/issues/113 * secrets.baseline update * fix import * update secrets.baseline * update platform-service-so-sdk version * Update .secrets.baseline * updated on PR review comments * Update cbr_zone.html.markdown
Community Note
Relates OR Closes #0000
Output from acceptance testing: