GithubHelp home page GithubHelp logo

lendi-au / terraform-provider-snyk Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 5.0 154 KB

Terraform Provider for configuring Snyk Organizations and projects.

Home Page: https://registry.terraform.io/providers/lendi-au/snyk

License: Mozilla Public License 2.0

Makefile 0.47% Go 99.53%
snyk snyk-automation terraform terraform-provider

terraform-provider-snyk's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-snyk's Issues

GCR integration Unexpected HTTP Status Code

Getting an error without any details when trying to apply a GCR integration

Terraform Version

Terraform v1.0.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v2.20.3
+ provider registry.terraform.io/lendi-au/snyk v0.2.0

Affected Resource(s)

  • snyk_integration

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "snyk_integration" "gcr" {
  organization = var.snyk_devops_org_id
  type         = "gcr"
  credentials {
    registry_base = "gcr.io"
    password      = google_service_account_key.svc_snyk_key.private_key
  }
}

Debug Output

2021-08-24T16:06:25.807Z [TRACE] vertex "snyk_integration.gcr": starting visit (*terraform.NodeApplyableResourceInstance)
2021-08-24T16:06:25.807Z [TRACE] vertex "provider[\"registry.terraform.io/hashicorp/google\"] (close)": starting visit (*terraform.graphNodeCloseProvider)
2021-08-24T16:06:25.807Z [TRACE] GRPCProvider: Close
2021-08-24T16:06:25.807Z [TRACE] readDiff: Read Create change from plan for snyk_integration.gcr
2021-08-24T16:06:25.808Z [TRACE] setValue: Saving Update change for output.svc_snyk_private_key_encrypted in changeset
2021-08-24T16:06:25.808Z [TRACE] setValue: Saving value for output.svc_snyk_private_key_encrypted in state
2021-08-24T16:06:25.808Z [TRACE] vertex "output.svc_snyk_private_key_encrypted": visit complete
2021-08-24T16:06:25.811Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/google/2.20.3/linux_amd64/terraform-provider-google_v2.20.3_x4 pid=38587
2021-08-24T16:06:25.811Z [DEBUG] provider: plugin exited
2021-08-24T16:06:25.811Z [TRACE] vertex "provider[\"registry.terraform.io/hashicorp/google\"] (close)": visit complete
2021-08-24T16:06:25.811Z [TRACE] readResourceInstanceState: reading state for snyk_integration.gcr
2021-08-24T16:06:25.811Z [TRACE] readResourceInstanceState: no state present for snyk_integration.gcr
2021-08-24T16:06:25.811Z [TRACE] readDiff: Read Create change from plan for snyk_integration.gcr
2021-08-24T16:06:25.812Z [TRACE] Re-validating config for "snyk_integration.gcr"
2021-08-24T16:06:25.812Z [TRACE] GRPCProvider: ValidateResourceConfig
2021-08-24T16:06:25.813Z [TRACE] GRPCProvider: PlanResourceChange
2021-08-24T16:06:25.815Z [TRACE] checkPlannedChange: Verifying that actual change (action Create) matches planned change (action Create)
2021-08-24T16:06:25.815Z [TRACE] readResourceInstanceState: reading state for snyk_integration.gcr
2021-08-24T16:06:25.815Z [TRACE] readResourceInstanceState: no state present for snyk_integration.gcr
snyk_integration.gcr: Creating...
2021-08-24T16:06:25.816Z [INFO]  Starting apply for snyk_integration.gcr
2021-08-24T16:06:25.816Z [DEBUG] snyk_integration.gcr: applying the planned Create change
2021-08-24T16:06:25.816Z [TRACE] GRPCProvider: ApplyResourceChange
2021-08-24T16:06:26.333Z [TRACE] maybeTainted: snyk_integration.gcr encountered an error during creation, so it is now marked as tainted
2021-08-24T16:06:26.333Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for snyk_integration.gcr
2021-08-24T16:06:26.333Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for snyk_integration.gcr
2021-08-24T16:06:26.333Z [TRACE] evalApplyProvisioners: snyk_integration.gcr is tainted, so skipping provisioning
2021-08-24T16:06:26.333Z [TRACE] maybeTainted: snyk_integration.gcr was already tainted, so nothing to do
2021-08-24T16:06:26.333Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState to workingState for snyk_integration.gcr
2021-08-24T16:06:26.333Z [TRACE] NodeAbstractResouceInstance.writeResourceInstanceState: removing state object for snyk_integration.gcr
2021-08-24T16:06:26.333Z [TRACE] vertex "snyk_integration.gcr": visit complete
2021-08-24T16:06:26.333Z [TRACE] dag/walk: upstream of "provider[\"registry.terraform.io/lendi-au/snyk\"] (close)" errored, so skipping
2021-08-24T16:06:26.333Z [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
2021-08-24T16:06:26.333Z [TRACE] dag/walk: upstream of "root" errored, so skipping
╷
│ Error: unexpected HTTP status code
│
│   with snyk_integration.gcr,
│   on snyk.tf line 1, in resource "snyk_integration" "gcr":
│    1: resource "snyk_integration" "gcr" {
│
╵
2021-08-24T16:06:26.668Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"

Expected Behavior

Create a snyk integration

Actual Behavior

Error

Steps to Reproduce

  1. terraform apply

Update exported attributes of the snyk_organization resource + import

The snyk_organization resources documentation is out of date and should be updated to reflect what is available. This includes the following

  • created
  • id
  • name
  • slug
  • url

I was only made aware that these were available after using the provider

Additionally an import is possible which is not noted in the documentation via the org id

[Feature Request] Retrieve Snyk Organization slug

Terraform Version

terraform -v
Terraform v1.3.4
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.44.0
+ provider registry.terraform.io/hashicorp/vault v3.11.0
+ provider registry.terraform.io/lendi-au/snyk v0.2.0

Affected Resource(s)

  • snyk_organization

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "snyk_organization" "snyk_orgs" {
  for_each = local.orgs
  name     = each.value.name
}

output "snyk_orgs" {
  description = "Snyk Organizations"
  value       = snyk_organization.snyk_orgs
}

Expected Behavior

Output should show more than just name

Actual Behavior

Only a list of names were returned. I see in the code, the Organization struct fetches the slug from the API:

type Organization struct {
Id string `json:"id,omitempty"`
Name string `json:"name"`
Slug string `json:"slug"`
Url string `json:"url"`
Created time.Time `json:"created,omitempty"`
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.