Skip to content

Commit

Permalink
Flesh out README with initial usage docs (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com>
  • Loading branch information
yorinasub17 authored Dec 20, 2022
1 parent 6acbdac commit 5bd774b
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# How to contribute to tf.libsonnet

**Filing issues**

- **Report bugs and feature requests on the libgenerator repository as GitHub issues**. This is an autogenerated
library, which means that any bugs and feature requests need to be reported on the [libgenerator
project](https://github.com/tf-libsonnet/libgenerator) which is responsible for generating this repository. If you
found an issue, you can open a new issue from [this
link](https://github.com/tf-libsonnet/libgenerator/issues/new/choose).
- **Do not open a GitHub issue if you are reporting a security vulnerability with the tf.libsonnet project**. Instead,
refer to our [security policy](/SECURITY.md).


**Contributing a change**

- **This is an autogenerated library**. This means that all contributions will not be merged until the changes can be
autogenerated from the generator. You may still open a Pull Request with a suggested change, especially if it helps
augment an issue description by providing an example of what should be generated.
- **All commits must be signed off to adhere to the Developer Certificate of Origin (DCO)**. If you are contributing a
change to `libgenerator`, note that the `tf.libsonnet` org requires all contributors to sign off on [the
DCO](https://developercertificate.org/). You can do this with the `-s` flag when making commits with `git commit`.
- If you forgot to sign off on any commits in a Pull Request, you can amend the offending commit with `git commit -s
--amend`.
- **All commits must be signed**. The `tf.libsonnet` org requires all contributors to [sign their
commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). If you do
not wish to maintain a set of private keys on your account, you can also use the
[sigstore/gitsign](https://github.com/sigstore/gitsign) project for keyless signing with your GitHub account.

**Support**

- Ask any question about how to use the `tf.libsonnet` libraries in the [Organization
GitHub Discussion](https://github.com/orgs/tf-libsonnet/discussions).
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,84 @@ This repository contains [Jsonnet](https://jsonnet.org/) functions for generatin
>
> If you would like to contribute a change, you may open a Pull Request with a suggested change, but please note that it
> will **not be merged in until the necessary updates have been made to the generator**.
## Usage

Install the package using [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler):

```
jb install github.com/tf-libsonnet/hashicorp-azuread@main
# Or if you want to install a specific release
# jb install github.com/tf-libsonnet/hashicorp-azuread@v0.0.1
# Or if you want to install bindings for a specific provider major version series
# jb install github.com/tf-libsonnet/hashicorp-azuread/2.x@main
```

You can then import the package in your Jsonnet code:

```jsonnet
// main.tf.json.jsonnet
local azuread = import 'github.com/tf-libsonnet/hashicorp-azuread/main.libsonnet';
local tid = '00000000-0000-0000-0000-000000000000';
local o =
azuread.data.client_config.new('current')
+ azuread.group.new(
'example',
display_name='example',
owners=[o._ref.data.azuread_client_config.current.get('object_id')],
security_enabled=true,
);
azuread.provider.new(tenant_id=tid, src='hashicorp/azuread')
+ o
```

This will generate the following Terraform JSON :

```json
{
"data": {
"azuread_client_config": {
"current": { }
}
},
"provider": {
"azuread": [
{
"tenant_id": "00000000-0000-0000-0000-000000000000"
}
]
},
"resource": {
"azuread_group": {
"example": {
"display_name": "example",
"owners": [
"${data.azuread_client_config.current.object_id}"
],
"security_enabled": true
}
}
},
"terraform": {
"required_providers": {
"azuread": {
"source": "hashicorp/azuread"
}
}
}
}
```

Refer to the [reference docs](/docs/2.x/README.md) for a list of supported data sources and resources:

- [provider config](/docs/2.x/provider.md)
- [resources](/docs/2.x/README.md)
- [data sources](/docs/2.x/data/index.md)

## Contributing

Refer to the [CONTRIBUTING.md](/CONTRIBUTING.md) document for information on how to contribute to `tf.libsonnet`.

0 comments on commit 5bd774b

Please sign in to comment.