-
Notifications
You must be signed in to change notification settings - Fork 12
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
xray_ignore_rule error out when cves and vulnerabilities #148
Comments
@Osazz In your example, since you don't want to have any |
Here is my full use case , I have existing ignore rules that were created from the UI that I would like to manage using Terraform. Here are the steps I took and how I endup here :
N.B running apply means new destroying existing resources and creating new one. Not ideal
So that is why I setting |
@Osazz Just so I understand correctly, the TF config you have before you import the resource contains resource "xray_ignore_rule" "ignore_rule" {
notes = "delete me now test ignore rule iac"
vulnerabilities = ["XRAY-170461"]
cves = []
} If you omit resource "xray_ignore_rule" "ignore_rule" {
notes = "delete me now test ignore rule iac"
vulnerabilities = ["XRAY-170461"]
} Then import the resource. After that The Xray APIs don't allow updating an existing ignore rule. Thus any mismatch of TF configuration and API data will mean the provider destroys and recreates new resource. |
@alexhung No that understanding is not correct. I have a TF config like this : resource "xray_ignore_rule" "ignore_rule" {
notes = "delete me now test ignore rule iac"
vulnerabilities = ["XRAY-170461"]
}
"instances": [
{
"schema_version": 0,
"attributes": {
...
"cves": null,
...
}
}
]
"instances": [
{
"schema_version": 0,
"attributes": {
...
"cves": [],
...
}
}
] What could have stopped the difference would have been me been able to give The only work around which I could think of was to change the state file manual by making |
@Osazz I see. Thanks for the clarification! I'll investigate this issue. |
@alexhung any update on this issue? |
…conflict Remove attribute conflict validation for 'cves' and 'vulnerabilities'
Describe the bug
TF resource xray_ignore_rule fails on plan when cves = [] and vulnerabilities = ["XRAY-170461"] with Conflicting configuration arguments
Requirements for and issue
Terraform Code
Additional context
If you create ignore rule from UI and you import it using
terraform import xray_ignore_rule.ignore_rule <rule-id>
"cves": null,
cves
value changed to[]
The text was updated successfully, but these errors were encountered: