Skip to content
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

feat: add group_sync and role_sync for coderd_organization_resource #147

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Nov 25, 2024

Group and role sync settings can now be configured as such:

resource "coderd_organization" "example" {
	group_sync {
		field = "wibble"
		regex_filter = "wib{2,}le"
		auto_create_missing = true
		mapping = {
			wibble = ["6e57187f-6543-46ab-a62c-a10065dd4314"]
		}
	}

	role_sync {
		field = "wobble"
		mapping = {
			wobble = ["wobbly"]
		}
	}
}

internal/provider/organization_resource_test.go Outdated Show resolved Hide resolved
internal/provider/organization_resource.go Outdated Show resolved Hide resolved
internal/provider/organization_resource.go Outdated Show resolved Hide resolved
return
}

// data.GroupSync = ???
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall if you can write to a config block (blocks can't be computed) like this. I suspect you can't.

If you can, I assume it would just be to error if the post-apply plan isn't empty.
For that you'd need to use types.ObjectValueFrom and provide it the type of the object using a map[string]attr.Type. I've got an example on the template resource & data source.

internal/provider/organization_resource.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants