Wednesday, July 14, 2021

terraform plugin download for cloud providers || AWS - GCP - Kubernetes - vSphere - Openstack

terraform initialization to download plugin for cloud providers || AWS - GCP - Kubernetes - vSphere - Openstack


Sample Initializing terraform script and downloading the plugins with providing the credentials:

AWS:

====
aws_main.tf
provider "aws" {
}

vSphere:

========
vsphere_main.tf
provider "vsphere" {
}

GCP:

====
google_main.tf
provider "google" {
}

Kubernetes:

===========
kubernetes_main.tf
provider "kubernetes" {
}

Openstack:

==========
openstack_main.tf
provider "openstack" {
}


Output:

=======

AWS:

[root@oraclemv AWS]# cat main.tf
provider "aws" {
}
[root@oraclemv AWS]# 

[root@oraclemv AWS]# ls -ltrha
total 4.0K
-rw-r--r--. 1 root root 21 Jul 14 14:47 main.tf
drwxr-xr-x. 7 root root 78 Jul 14 14:50 ..
drwxr-xr-x. 2 root root 21 Jul 14 14:50 .
[root@oraclemv AWS]#

[root@oraclemv AWS]# terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/aws...
- Installing hashicorp/aws v3.49.0...
- Installed hashicorp/aws v3.49.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
[root@oraclemv AWS]#

[root@oraclemv AWS]# ls -ltra
total 8
-rw-r--r--. 1 root root   21 Jul 14 14:47 main.tf
drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
drwxr-xr-x. 3 root root   23 Jul 14 15:07 .terraform
-rw-r--r--. 1 root root 1077 Jul 14 15:07 .terraform.lock.hcl
drwxr-xr-x. 3 root root   66 Jul 14 15:07 .
[root@oraclemv AWS]# 

[root@oraclemv AWS]# cd .terraform/providers/registry.terraform.io/hashicorp/aws/3.49.0/linux_amd64/
[root@oraclemv linux_amd64]# ll
total 181720
-rwxr-xr-x. 1 root root 186081280 Jul 14 15:07 terraform-provider-aws_v3.49.0_x5
[root@oraclemv linux_amd64]#

vSphere:

[root@oraclemv vSpeher]# cat main.tf
provider "vsphere" {
}
[root@oraclemv vSpeher]#

[root@oraclemv vSpeher]# ls -ltra
total 8
drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
-rw-r--r--. 1 root root   24 Jul 14 14:50 main.tf
drwxr-xr-x. 3 root root   66 Jul 14 15:12 .
[root@oraclemv vSpeher]#

[root@oraclemv vSpeher]# terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/vsphere...
- Installing hashicorp/vsphere v2.0.2...
- Installed hashicorp/vsphere v2.0.2 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
[root@oraclemv vSpeher]#

[root@oraclemv vSpeher]# cd .terraform/providers/registry.terraform.io/hashicorp/vsphere/2.0.2/linux_amd64/
[root@oraclemv linux_amd64]# ll
total 32032
-rwxr-xr-x. 1 root root 32800768 Jul 14 15:12 terraform-provider-vsphere_v2.0.2_x5
[root@oraclemv linux_amd64]#

GCP:

[root@oraclemv GCP]# cat main.tf
provider "google" {
}
[root@oraclemv GCP]#

[root@oraclemv GCP]# ls -ltra
total 8
drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
-rw-r--r--. 1 root root   23 Jul 14 14:54 main.tf
drwxr-xr-x. 3 root root   66 Jul 14 15:10 .
[root@oraclemv GCP]#

[root@oraclemv GCP]# terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/google...
- Installing hashicorp/google v3.75.0...
- Installed hashicorp/google v3.75.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
[root@oraclemv GCP]# 

[root@oraclemv GCP]# cd .terraform/providers/registry.terraform.io/hashicorp/google/3.75.0/linux_amd64/
[root@oraclemv linux_amd64]# ll
total 62760
-rwxr-xr-x. 1 root root 64266240 Jul 14 15:10 terraform-provider-google_v3.75.0_x5
[root@oraclemv linux_amd64]#

Kubernetes:

[root@oraclemv Kubernetes]# cat main.tf
provider "kubernetes" {
}
[root@oraclemv Kubernetes]#

[root@oraclemv Kubernetes]# ls -ltrah
total 8.0K
drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
-rw-r--r--. 1 root root   27 Jul 14 14:59 main.tf
drwxr-xr-x. 3 root root   66 Jul 14 15:11 .
[root@oraclemv Kubernetes]#

[root@oraclemv Kubernetes]# terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/kubernetes...
- Installing hashicorp/kubernetes v2.3.2...
- Installed hashicorp/kubernetes v2.3.2 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
[root@oraclemv Kubernetes]#

[root@oraclemv Kubernetes]# cd .terraform/providers/registry.terraform.io/hashicorp/kubernetes/2.3.2/linux_amd64/
[root@oraclemv linux_amd64]# ll
total 47408
-rwxr-xr-x. 1 root root 48545792 Jul 14 15:11 terraform-provider-kubernetes_v2.3.2_x5
[root@oraclemv linux_amd64]#

Openstack:

[root@oraclemv Openstack]# cat main.tf
provider "openstack" {
}
[root@oraclemv Openstack]#

[root@oraclemv Openstack]# ls -ltrah
total 4.0K
drwxr-xr-x. 7 root root 78 Jul 14 14:50 ..
-rw-r--r--. 1 root root 26 Jul 14 14:52 main.tf
drwxr-xr-x. 2 root root 21 Jul 14 14:52 .
[root@oraclemv Openstack]#

[root@oraclemv Openstack]# terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/openstack...
│ Error: Failed to query available provider packages
│ Could not retrieve the list of available versions for provider hashicorp/openstack: could not connect to registry.terraform.io: Failed to request
│ discovery document: Get "https://registry.terraform.io/.well-known/terraform.json": net/http: request canceled while waiting for connection
│ (Client.Timeout exceeded while awaiting headers)
[root@oraclemv Openstack]#

Regards,
Mallik

No comments:

Post a Comment

Automation Script | Archivelog Generation Hourly Monitoring

1. List out all the running databases and pic one database where we want to monitore the archive log generation from last 1 month. [oracle@o...