Skip to content

Commit

Permalink
Merge pull request #4 from nyuen/master
Browse files Browse the repository at this point in the history
Publishing the provider to the Terraform registry
  • Loading branch information
yaegashi authored Jul 20, 2020
2 parents 84e78af + 6a5e918 commit bf5611b
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 73 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
push:
tags:
- '*'
- 'v*'
jobs:
go_releaser:
name: GoReleaser
Expand All @@ -17,11 +17,23 @@ jobs:
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: lint
run: go run github.com/bflad/tfproviderlint/cmd/tfproviderlint ./...
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
if: always()

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
if: always()

49 changes: 38 additions & 11 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.

before:
hooks:
- go mod tidy
- go test -v ./...
builds:
- goos: [linux, darwin, windows]
goarch: [amd64]
binary: 'terraform-provider-msgraph{{if eq (printf "%.8s" .Version) "snapshot"}}_v{{.Version}}{{end}}'
- env:
- CGO_ENABLED=0
goos:
- freebsd
- openbsd
- solaris
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
- goos: openbsd
goarch: arm
- goos: openbsd
goarch: arm64
- goos: freebsd
goarch: arm64
binary: '{{ .ProjectName }}_{{ .Version }}'
archives:
- name_template: '{{.ProjectName}}_{{if ne (printf "%.8s" .Version) "snapshot"}}v{{end}}{{.Version}}_{{ .Os }}_{{ .Arch }}'
format_overrides:
- goos: windows
format: zip
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "snapshot-{{.ShortCommit}}"
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- artifacts: checksum
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
release:
# Visit your project's GitHub Releases page to publish this release.
draft: true
changelog:
skip: true
72 changes: 72 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Terraform Provider for Microsoft Graph

implementation of Terraform provider for Microsoft Graph using msgraph.go.
One of the main purposes of this provider is to become an alternative to the official Azure Active Directory provider.
You need Terraform v0.12 and an Azure AD tenant with the admin privilege.

## Example Usage

```hcl
provider "msgraph" {
tenant_id = "common"
client_id = "82492584-8587-4e7d-ad48-19546ce8238f"
client_secret = "" // empty for device code authorization
token_cache_path = "token_cache.json"
}
resource "msgraph_group" "demo_office365_group" {
display_name = "Demo Office365 Group"
mail_nickname = "demo_office365_group"
group_types = ["Unified"]
visibility = "Private"
}
```

## Provider configuration

The provider has the configuration with the following default values. You can modify the default values with the corresponding environment variables.

```hcl
provider "msgraph" {
tenant_id = "common" // env:ARM_TENANT_ID
client_id = "82492584-8587-4e7d-ad48-19546ce8238f" // env:ARM_CLIENT_ID
client_secret = "" // env:ARM_CLIENT_SECRET
token_cache_path = "token_cache.json" // env:ARM_TOKEN_CACHE_PATH
console_device_path = "/dev/tty" // env:ARM_CONSOLE_DEVICE_PATH
}
```

The default configuration above is to use the public client defined in l0w.dev tenant with the permission Directory.AccessAsUser.All. You can use it to make terraform to access your tenant's directory with the delegated privilege.

When client_secret is empty, the provider attempts the device code authorization. You can see the following message on the first invocation of terraform plan:

```bash
$ terraform 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.

To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code GNATKX4J8 to authenticate.
```

Open <https://microsoft.com/devicelogin> with your web browser and enter the code to proceed the authorization steps. After completing authorization it stores auth tokens in a file specified by token_cache_path. On subsequent terraform invocations it can skip the authorization steps above with this file.

You can also specify an Azure Blob URL with SAS for `token_cache_path`. It's recommended to pass it via `ARM_TOKEN_CACHE_PATH` envvar since the SAS is considered sensitive information that should be hidden.

The provider opens `console_device_path` to prompt the instruction of the device code authorization. It might have no acccess to /dev/tty in the restricted environment like GitLab CI runner. You can workaround it by fd number device and redirection with the shell as follows:

```console
$ 99>&2 ARM_CONSOLE_DEVICE_PATH=/dev/fd/99 terraform plan
```

## Supported resources

* Data sources
* data_group
* data_user
* Resources
* msgraph_application
* msgraph_application_password
* msgraph_group
* msgraph_group_member
* msgraph_user
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
cloud.google.com/go/storage v1.10.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/aws/aws-sdk-go v1.32.11 // indirect
github.com/bflad/tfproviderlint v0.14.0
github.com/fatih/color v1.9.0 // indirect
github.com/google/uuid v1.1.1
github.com/hashicorp/go-getter v1.4.1 // indirect
Expand Down
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ
github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.32.11 h1:1nYF+Tfccn/hnAZsuwPPMSCVUVnx3j6LKOpx/WhgH0A=
github.com/aws/aws-sdk-go v1.32.11/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/bflad/gopaniccheck v0.1.0 h1:tJftp+bv42ouERmUMWLoUn/5bi/iQZjHPznM00cP/bU=
github.com/bflad/gopaniccheck v0.1.0/go.mod h1:ZCj2vSr7EqVeDaqVsWN4n2MwdROx1YL+LFo47TSWtsA=
github.com/bflad/tfproviderlint v0.14.0 h1:iki5tDr4l0jp0zEL0chZylptMT5QdE09E60cziFQNZA=
github.com/bflad/tfproviderlint v0.14.0/go.mod h1:1Jtjs6DPKoyqPrbPyMiy33h0ViO2h831uzoOuikCA60=
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4=
github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=
Expand Down Expand Up @@ -164,6 +168,7 @@ github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uP
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI=
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY=
github.com/hashicorp/go-plugin v1.2.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0=
github.com/hashicorp/go-plugin v1.3.0 h1:4d/wJojzvHV1I4i/rrjVaeuyxWrLzDE1mDCyDy8fXS8=
github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0=
Expand Down Expand Up @@ -191,9 +196,13 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY=
github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A=
github.com/hashicorp/terraform-json v0.4.0 h1:KNh29iNxozP5adfUFBJ4/fWd0Cu3taGgjHB38JYqOF4=
github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU=
github.com/hashicorp/terraform-plugin-sdk v1.7.0/go.mod h1:OjgQmey5VxnPej/buEhe+YqKm0KNvV3QqU4hkqHqPCY=
github.com/hashicorp/terraform-plugin-sdk v1.14.0 h1:sUKcw7OHqDXhBarlHjv+/yMCr8eEb1lO8CGQ3pEEFiE=
github.com/hashicorp/terraform-plugin-sdk v1.14.0/go.mod h1:t62Xy+m7Zjq5tA2vrs8Wuo/TQ0sc9Mx9MjXL3+7MHBQ=
github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs=
github.com/hashicorp/terraform-plugin-test v1.3.0 h1:hU5LoxrOn9qvOo+LTKN6mSav2J+dAMprbdxJPEQvp4U=
github.com/hashicorp/terraform-plugin-test v1.3.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs=
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg=
github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg=
Expand Down Expand Up @@ -247,6 +256,7 @@ github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/cli v1.1.1 h1:J64v/xD7Clql+JVKSvkYojLOXu1ibnY9ZjGLwSt/89w=
github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
Expand Down Expand Up @@ -427,6 +437,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03i
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -437,6 +448,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -495,6 +507,8 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200214201135-548b770e2dfa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200216192241-b320d3a0f5a2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
Expand Down Expand Up @@ -571,6 +585,7 @@ google.golang.org/genproto v0.0.0-20200623002339-fbb79eadd5eb/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5 h1:a/Sqq5B3dGnmxhuJZIHFsIxhEkqElErr5TaU6IqBAj0=
google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
Expand Down
4 changes: 2 additions & 2 deletions msgraph/data_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func newDataGroup(d *schema.ResourceData, m interface{}) *dataGroup {
}
}

func dataGroupRead(d *schema.ResourceData, m interface{}) error {
return newDataGroup(d, m).read()
func dataGroupRead(d *schema.ResourceData, meta interface{}) error {
return newDataGroup(d, meta).read()
}

func (d *dataGroup) graphSet(group *msgraph.Group) {
Expand Down
8 changes: 4 additions & 4 deletions msgraph/data_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ type dataUser struct {
data *schema.ResourceData
}

func newDataUser(d *schema.ResourceData, m interface{}) *dataUser {
func newDataUser(d *schema.ResourceData, meta interface{}) *dataUser {
return &dataUser{
graph: newGraph(m),
graph: newGraph(meta),
data: d,
}
}

func dataUserRead(d *schema.ResourceData, m interface{}) error {
return newDataUser(d, m).read()
func dataUserRead(d *schema.ResourceData, meta interface{}) error {
return newDataUser(d, meta).read()
}

func (d *dataUser) graphSet(user *msgraph.User) {
Expand Down
22 changes: 11 additions & 11 deletions msgraph/resource_application password.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func resourceApplicationPasswordResource() *schema.Resource {
Schema: map[string]*schema.Schema{
"application_id": {Type: schema.TypeString, Required: true, ForceNew: true},
"display_name": {Type: schema.TypeString, Required: true, ForceNew: true},
"start_date_time": {Type: schema.TypeString, ValidateFunc: validation.ValidateRFC3339TimeString, Optional: true, Computed: true, ForceNew: true},
"end_date_time": {Type: schema.TypeString, ValidateFunc: validation.ValidateRFC3339TimeString, Optional: true, Computed: true, ForceNew: true},
"start_date_time": {Type: schema.TypeString, ValidateFunc: validation.IsRFC3339Time, Optional: true, Computed: true, ForceNew: true},
"end_date_time": {Type: schema.TypeString, ValidateFunc: validation.IsRFC3339Time, Optional: true, Computed: true, ForceNew: true},
"secret_text": {Type: schema.TypeString, Computed: true, Sensitive: true},
},
}
Expand All @@ -29,23 +29,23 @@ type resourceApplicationPassword struct {
resource *schema.ResourceData
}

func newResourceApplicationPassword(r *schema.ResourceData, m interface{}) *resourceApplicationPassword {
func newResourceApplicationPassword(d *schema.ResourceData, meta interface{}) *resourceApplicationPassword {
return &resourceApplicationPassword{
graph: newGraph(m),
resource: r,
graph: newGraph(meta),
resource: d,
}
}

func resourceApplicationPasswordCreate(r *schema.ResourceData, m interface{}) error {
return newResourceApplicationPassword(r, m).create()
func resourceApplicationPasswordCreate(d *schema.ResourceData, meta interface{}) error {
return newResourceApplicationPassword(d, meta).create()
}

func resourceApplicationPasswordRead(r *schema.ResourceData, m interface{}) error {
return newResourceApplicationPassword(r, m).read()
func resourceApplicationPasswordRead(d *schema.ResourceData, meta interface{}) error {
return newResourceApplicationPassword(d, meta).read()
}

func resourceApplicationPasswordDelete(r *schema.ResourceData, m interface{}) error {
return newResourceApplicationPassword(r, m).delete()
func resourceApplicationPasswordDelete(d *schema.ResourceData, meta interface{}) error {
return newResourceApplicationPassword(d, meta).delete()
}

func (r *resourceApplicationPassword) graphSet(pc *msgraph.PasswordCredential) {
Expand Down
24 changes: 12 additions & 12 deletions msgraph/resource_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func resourceApplicationResource() *schema.Resource {
"enable_id_token_issuance": {Type: schema.TypeBool, Optional: true},
"enable_access_token_issuance": {Type: schema.TypeBool, Optional: true},
"api": {
Type: schema.TypeSet,
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Elem: &schema.Resource{
Expand Down Expand Up @@ -110,27 +110,27 @@ type resourceApplication struct {
resource *schema.ResourceData
}

func newResourceApplication(r *schema.ResourceData, m interface{}) *resourceApplication {
func newResourceApplication(d *schema.ResourceData, meta interface{}) *resourceApplication {
return &resourceApplication{
graph: newGraph(m),
resource: r,
graph: newGraph(meta),
resource: d,
}
}

func resourceApplicationCreate(r *schema.ResourceData, m interface{}) error {
return newResourceApplication(r, m).create()
func resourceApplicationCreate(d *schema.ResourceData, meta interface{}) error {
return newResourceApplication(d, meta).create()
}

func resourceApplicationRead(r *schema.ResourceData, m interface{}) error {
return newResourceApplication(r, m).read()
func resourceApplicationRead(d *schema.ResourceData, meta interface{}) error {
return newResourceApplication(d, meta).read()
}

func resourceApplicationUpdate(r *schema.ResourceData, m interface{}) error {
return newResourceApplication(r, m).update()
func resourceApplicationUpdate(d *schema.ResourceData, meta interface{}) error {
return newResourceApplication(d, meta).update()
}

func resourceApplicationDelete(r *schema.ResourceData, m interface{}) error {
return newResourceApplication(r, m).delete()
func resourceApplicationDelete(d *schema.ResourceData, meta interface{}) error {
return newResourceApplication(d, meta).delete()
}

func (r *resourceApplication) graphSet(application *msgraph.Application) {
Expand Down
Loading

0 comments on commit bf5611b

Please sign in to comment.