Giter Club home page Giter Club logo

terraform-provider-pypi's Introduction

terraform-provider-pypi

Terraform provider aimed at facilitating downloading Python requirements when needed during Terraform runs. For example, when packaging an AWS lambda deployment.

Usage

Downloading the latest release of a package to a directory (this will attempt to download a bdist_wheel artifact by default and fallback to a sdist only if the *whl file isn't available):

data "pypi_package_file" "hvac_latest" {
  name       = "hvac"
  output_dir = "${path.module}/hvac_latest"
}

Downloading a specific version:

data "pypi_package_files" "mah_requirements" {
  requirements_file = "${path.module}/requirements.txt"
  output_dir = "${path.module}/hvac_0-10-1"
}

Development

Installing Locally

$ VERSION=0.0.1 make install
GO111MODULE=on go build -o ./bin/terraform-provider-pypi_0.0.1
cp ./bin/terraform-provider-pypi_0.0.1 ~/.terraform.d/plugins/

Releases

# Hit CTRL+d after typing some stuff to cache your GPG key password...
$ gpg --armor --detach-sign
hi
-----BEGIN PGP SIGNATURE-----
[...]
-----END PGP SIGNATURE-----
$ export GITHUB_TOKEN='<personal access token with public_repo scope>'
$ git tag v0.0.1
$ goreleaser release --rm-dist

terraform-provider-pypi's People

Contributors

jeffwecan avatar

Stargazers

Andy Méry avatar  avatar

Watchers

James Cloos avatar  avatar Valentin Hristev avatar

terraform-provider-pypi's Issues

Configuring private pypi repo does not work

Hey ,

I'm trying to configure private repo in > examples/package_file/variables.tf and TF plan is failing. If I put https://pypi.org or https://test.pypi.org for address its works. I tried two JFROG artifactories which are private for our company and its failing.

variable "pypi_address" {
  type = string
  default = "https://MY_PRIVATE_REPO"
}

Example of the private repo:
https://MY_HOST/artifactory/api/pypi/pypi-virtual/simple

e(master*) » tf plan

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.pypi_package_file.hvac_latest: Refreshing state...

Error: no release found to download for hvac v

  on package_file.tf line 22, in data "pypi_package_file" "hvac_latest":
  22: data "pypi_package_file" "hvac_latest" {

cat package_file.tf

terraform {
  required_providers {
    pypi = {
      source  = "jeffwecan/pypi"
      version = "0.0.9"
    }
  }
}

provider "pypi" {
  address = "https://JFROG-PRIVATE-REPO/artifactory/api/pypi/pypi-virtual/simple"
}

data "pypi_package_file" "hvac_latest" {
  name = "hvac"
  #output_dir = "${path.module}/hvac"
  output_dir = "./hvac"
}

I run the TF Plan with TF_LOG=TRACE but I could not find anything. Those JFROG private repos are proxies.
I tried all kinds of ways without success.

Could you please check if the provider is working if you specify a private repo?

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.