Skip to content

Commit

Permalink
prepare new version
Browse files Browse the repository at this point in the history
  • Loading branch information
ITMonta committed Nov 22, 2020
1 parent a1afb95 commit d144b4a
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 21 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/*.tfstate
**/*.tfstate.backup
**/*.idea
**/.terraform
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ NAMESPACE=Kaginari
NAME=mongodb
VERSION=0.0.1
## on linux base os
TERRAFORM_PLUGINS_DIRECTORY=~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
#TERRAFORM_PLUGINS_DIRECTORY=/mnt/c/Users/monta/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
#TERRAFORM_PLUGINS_DIRECTORY=~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
TERRAFORM_PLUGINS_DIRECTORY=/mnt/c/Users/monta/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}


install:
Expand Down
4 changes: 0 additions & 4 deletions docker/docker-compose.yaml → docker/docker-compose-ssl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ services:
volumes:
mongo_data: {}
config_db: {}



#docker run --name mongo -v /mnt/c/Users/monta/go/src/github.com/Kaginari/terraform-provider-mongodb/docker/conf/mongod.conf:/etc/mongo/mongod.conf -v /mnt/c/Users/monta/go/src/github.com/Kaginari/terraform-provider-mongodb/docker/certifs:/data/mongo -p 27017:27017 --network docker_network --env MONGODB_USER=admin --env MONGODB_PASS:all0.1EN2.3ce --env MONGODB_DATABASE=admin -d mongo --config /etc/mongo/mongod.conf
41 changes: 41 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version: '3.1'

networks:
network:
driver: bridge

services:
mongo:
container_name: mongo
image: mongo:3.6
restart: always
environment:
- MONGODB_USER:admin
- MONGODB_PASS:all0.1EN2.3ce
- MONGODB_DATABASE=admin
volumes:
- mongo_data:/data/db
ports:
- 27017:27017
networks:
- network
mongo-express:
image: mongo-express
container_name: mongo-express
ports:
- 8081:8081
environment:
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: all0.1EN2.3ce
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_MONGODB_ADMINUSERNAME: admin
ME_CONFIG_MONGODB_ADMINPASSWORD: all0.1EN2.3ce
links:
- mongo:mongo
networks:
- network
depends_on:
- mongo
volumes:
mongo_data: {}
3 changes: 0 additions & 3 deletions examples/.terraform/plugin_path

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions examples/.terraform/plugins/selections.json

This file was deleted.

13 changes: 11 additions & 2 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ terraform {
}

provider "mongodb" {
host = "kaginari.herokuapp.com"
host = "127.0.0.1"
port = "27017"
username = "root"
password = "root"
ssl = true
ssl = false
auth_database = "admin"
}

Expand Down Expand Up @@ -69,5 +69,14 @@ resource "mongodb_db_user" "user" {
role = "readAnyDatabase"
db = "admin"
}
role {
role = "readWrite"
db = "local"
}
role {
role = "readWrite"
db = "monta"
}


}
10 changes: 9 additions & 1 deletion examples/terraform.tfstate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "0.13.4",
"serial": 5,
"serial": 40,
"lineage": "4094082a-1e0b-cfb1-64b4-ef367e48be17",
"outputs": {},
"resources": [
Expand Down Expand Up @@ -109,6 +109,14 @@
{
"db": "admin",
"role": "readAnyDatabase"
},
{
"db": "local",
"role": "readWrite"
},
{
"db": "monta",
"role": "readWrite"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion mongodb/resource_db_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func resourceDatabaseRole() *schema.Resource {
"privilege": {
Type: schema.TypeSet,
Optional: true,
MaxItems: 5,
MaxItems: 10,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{

Expand Down
2 changes: 1 addition & 1 deletion mongodb/resource_db_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func resourceDatabaseUser() *schema.Resource {
"role": {
Type: schema.TypeSet,
Optional: true,
MaxItems: 2,
MaxItems: 10,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"db": {
Expand Down

0 comments on commit d144b4a

Please sign in to comment.