Comments (6)
@alexhung ☝️
from terraform-provider-project.
@chb0github We have a ticket for this, scheduled for current sprint for me to work on.
from terraform-provider-project.
Ok. So what you are saying is that,
- repos a,b,c -> project1. but that
- project1 in TF has no knowledge of this and so when you go to manage the project, it sends no repos ('cause they aren't configured in the project hcl) and thus blows them away
2 things
- It seems to me that you're trying to manage the repos and the project entirely independently or inappropriately. For example, when you create the project you should be referencing the repo previously created in TF or vice versa. I mean, the only explanation that they are unaware of each other (and managed by TF) is because you didn't link them in HCL
- Have you tried to import project state?
The reason this can't/doesn't work like groups/users is because those are managed by artifactory - in the same app. I mean, it requires some inside baseball explanation, but basically the jfrog platform is composed of several microservices and projects is a totally different micro service. You can take it up with the platform team in a support ticket
We really need to get some hcl and steps that repo this.
from terraform-provider-project.
@chb0github Sorry I didn't comment here earlier today. I started digging into this and found out why it may not be working as @mikeycmccarthy described.
In the project API, there's no way to get the repositories that are currently assigned to the project. So the code fetches all the repositories with the project key as the query in the repository API. This means after the read()
, the project state now contains the repo keys, even though they were never specified in the HCL. This creates the relationships at the project side which is undesirable when the users want to manage it purely at the repository side.
I'm working on a PR that will break this undesirable link between project and repositories.
from terraform-provider-project.
@mikeycmccarthy By the way, I can't reproduce this behavior:
This does not seem to work the same way between projects and repositories. If I create a repository and include a project_key, if that repository then isn't in the list passed to projects (even if that attribute is missing) then the relationship is revoked.
The HCL I'm using:
# Required for Terraform 0.13 and up (https://www.terraform.io/upgrade-guides/0-13.html)
terraform {
required_providers {
project = {
source = "registry.terraform.io/jfrog/project"
version = "1.1.2"
}
artifactory = {
source = "registry.terraform.io/jfrog/artifactory"
version = "6.9.2"
}
}
}
provider "project" {
// supply ARTIFACTORY_USERNAME, _PASSWORD and _URL as env vars
}
provider "artifactory" {
// supply ARTIFACTORY_USERNAME, _PASSWORD and _URL as env vars
}
resource "project" "myproject" {
key = "myproj"
display_name = "My Project"
description = "My Project"
admin_privileges {
manage_members = true
manage_resources = true
index_resources = true
}
max_storage_in_gibibytes = 10
block_deployments_on_limit = false
email_notification = true
repos = []
}
resource "artifactory_remote_docker_repository" "remote-docker" {
key = format("%s-remote-docker", project.myproject.key)
project_key = project.myproject.key
external_dependencies_enabled = true
external_dependencies_patterns = ["**/hub.docker.io/**", "**/bintray.jfrog.io/**"]
enable_token_authentication = true
url = "https://hub.docker.io/"
block_pushing_schema1 = true
}
The result in the remote repository myproject-remote-docker
assigned to the project myproject
.
Please provide an example HCL that doesn't work so we can investigate that.
from terraform-provider-project.
Upon talking with @alexhung and really thinking hard on this, I see this as a "works as designed" - We can reopen it with some more requests. It's not that it doesn't work, it just doesn't work as you'd prefer
from terraform-provider-project.
Related Issues (20)
- Project Key param does not support 2 characters as mentioned in the docs and the UI HOT 2
- Inconsistency of terraform code for jfrog artifactory provider for federated repos. HOT 15
- Unable to install provider in OpenTofu HOT 4
- Enhance Terraform Support for Simultaneously Managing Shared and Assigned Repositories in Artifactory HOT 14
- Error: expected "access_token" to not be an empty string when project provider is removed HOT 5
- Empty lists as resource attribute value resolve to the predefined default, rather than an empty list. HOT 1
- Cyclic dependency when creating terraform code that creates a project and some related repositories. HOT 4
- Possible logic negation bug on block_deployments_on_limit HOT 3
- Not able to manage users in project with project admin role permissions using terraform. HOT 7
- Terraform import error for JFrog Project HOT 2
- Creation of Project Environments using Terraform HOT 1
- provider failed with terraform 1.5.3 HOT 5
- Support sharing repositories between projects HOT 5
- [FEATURE] Add User/Group to project independent after the project is created HOT 7
- Terraform destroy has issues when using for_each for the project resource HOT 6
- Creation of Project Roles using Terraform HOT 5
- Importing project environment shows diff HOT 6
- Project key length HOT 1
- Deleting project fails sometimes HOT 1
- Allow project members to be missing (due to API limitations on checking user availability) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-project.