terraform-provider | This repo has been deprecated and please | Infrastructure Automation library
kandi X-RAY | terraform-provider Summary
kandi X-RAY | terraform-provider Summary
[DEPRECATED] This repo has been deprecated and please access
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of terraform-provider
terraform-provider Key Features
terraform-provider Examples and Code Snippets
Community Discussions
Trending Discussions on terraform-provider
QUESTION
Context: I'm developing a TF Provider and I could see the latest "Writing Log Output" doc from HashiCorp where they recommend using tflog
package for logging.
That said, I can see TF Provider for GCP are still using log
package. What're the advantages of using tflog
over log
?
ANSWER
Answered 2022-Mar-29 at 19:35The Structured Logging section of the documentation you linked describes the authors' justification for recommending this different logging strategy:
The
tflog
package uses structured logging, based on go-hclog. Rather than writing logs as sentences with embedded variables and values,tflog
takes a sentence describing the logging event and a set of variables to log. When variables are separate from the log description, you can use them to programmatically parse, filter, and search log output. This separation also allows other parts of the system to associate variables with downstream log output.
Although not mentioned explicitly as an advantage in the documentation, it does also mention that tflog
has a notion of log levels, and there's no corresponding concept in the standard library log
package at the time of writing.
Given that, I would conclude that the two intended advantages of tflog
over standard library log
are:
tflog
uses a structured logging approach where the separate variables in the result are machine-parsable and therefore amenable to automated filtering via scripts.tflog
associates a log level with each message, and the SDKs allow customizing the log level for a particular execution to control the amount of output.
I think getting any further context on this would require asking the authors of the SDKs, since this is a subjective design tradeoff rather than a situation where there is one clear correct answer.
I assume that some existing providers continue to use standard library log
just because that code was written before tflog
existed. tflog
v0.2.0 (apparently the first publicly-published version) was released in December 2021, whereas big Terraform providers like the Google Cloud Platform provider have been under development for almost a decade before that.
QUESTION
I am currently working on trying to manage a resource with Terraform that has no delete method, and terraform insists there must be one.
...ANSWER
Answered 2022-Mar-16 at 12:37You are also missing a Create for this API endpoint. With only Update and Read supported, you will need to extend Create to be the same as Update except for additionally adding the resource to the state. You can easily invoke the Update function within the Create function for this behavior.
For the delete function, this should actually be easier than you may expect. The Terraform provider SDKv2 and your resource code should automatically Read the resource prior to attempting the delete to verify that it actually exists (this probably requires no extra effort on your part without seeing the code). Then you would need to remove the resource from the state with d.SetId("")
where d
is of type *schema.ResourceData
. However, this also automatically is invoked assuming the Delete returns no errors. Therefore, you could define a Delete that merely returns warnings or errors of an appropriate Go type. If you do not need that (and probably would not considering the minimal functionality), then you could probably just return nil
. Part of this is speculation based on what your code probably looks like, but in general this all holds true.
QUESTION
I tried to use newer_noncurrent_versions in S3 Lifecycle.
In Terraform 4.3.0, lifecycle was released.
However, when applying on Terraform cloud, an error saying to use Lifecycle V2 occurred.
Is my code the problem? Is it a terraform provider problem?
Terraform CLI and Terraform AWS Provider Version ...ANSWER
Answered 2022-Mar-07 at 06:06Your are missing filter
in the rule:
QUESTION
I am trying to deploy a new infrastructure using terraform (for the first time) and I am getting the following error. I've tried everything but nothing seems to fix the issue.
Looks like it is asking for a provider hashicorp/azure ?
Can anyone help please??
...ANSWER
Answered 2022-Mar-01 at 14:32This often happens when one accidentally specifies "hashicorp/azure" instead of "hashicorp/azurerm" in the required_providers block. Did you check the "vm" module referenced in the "azure_instance" module calls? There might be an erroneous "hashicorp/azure" specified there.
QUESTION
I am trying to create Lambda function using Terraform. There is no permission issue.
...ANSWER
Answered 2022-Feb-22 at 21:17I was able to successfully create the lambda function and IAM role resources;
QUESTION
I had issue
...ANSWER
Answered 2022-Feb-14 at 17:24The hashicorp/aws
provider must send requests to the AWS API that are signed using the AWS Signature Version 4 algorithm.
One of the goals of the AWS signing scheme is to minimize the time window that a compromised signature couuld be reused by an attacker. To achieve that, the signature scheme includes a timestamp when the signature was created and the remote system requires that the timestamp be within 15 minutes of the request time as understood by the remote system.
The official documentation describes this as follows, at the time I'm writing this:
- Protect against reuse of the signed portions of the request – The signed portions (using AWS Signatures) of requests are valid within 15 minutes of the timestamp in the request. An unauthorized party who has access to a signed request can modify the unsigned portions of the request without affecting the request's validity in the 15 minute window. Because of this, we recommend that you maximize protection by signing request headers and body, making HTTPS requests to Amazon S3, and by using the s3:x-amz-content-sha256 condition key (see Amazon S3 Signature Version 4 Authentication Specific Policy Keys) in AWS policies to require users to sign Amazon S3 request bodies.
If your local system has an incorrect system time or if your system believes its local time to be in a different timezone than you are actually working in then the AWS SDK (which the Terraform AWS provider is built with) will generate a timestamp outside of the allowed 15 minute window, and so your request will fail. This would be true of any request to AWS APIs using this standard signature scheme, whether made by Terraform's AWS provider or by any other AWS-integrated tool.
In order for requests to succeed your system must be able to generate a correct UTC-referenced timestamp. In order for that to be true, it must have both a correct time and – if you are using an operating system like Windows where the system time is stored in local time rather than UTC – a correct configuration of your system time's offset from UTC so that the SDK can convert to a UTC timestamp as the AWS API requires.
QUESTION
I'm pretty new to Terraform. I'm trying to use the sops provider plugin for encrypting secrets from a yaml file: Sops Provider
I need to create a Terraform user object for a later provisioning stage like this example:
...ANSWER
Answered 2022-Feb-07 at 18:46I think the "set of map of string" part of this error message is the important part: for_each
requires either a map directly (in which case the map keys become the instance identifiers) or a set of individual strings (in which case those strings become the instance identifiers).
Your example YAML file shows yaml_users
being defined as a YAML sequence of maps, which corresponds to a tuple of objects on conversion with yamldecode
.
To use that data structure with for_each
you'll need to first project it into a map whose keys will serve as the unique identifier for each instance of the resource. Assuming that the name
values are suitably unique, you could project it so that those values are the keys:
QUESTION
I am trying to automate the deployment of VM's in Vcloud using terraform. The server that I am using doesn't have an internet connection so I had to install terraform and VCD provider offline. Terrafom init worked but when I use terraform plan is crashing... Terraform version: 1.0.11 VCD provider version: 3.2.0(I am using this version because we have vcloud 9.7). This is a testing script, to see if terraform works
...ANSWER
Answered 2022-Jan-12 at 08:33I have found the issue. At the URL I was using the IP address of the Vcloud api, and for some reason terraform didn't like that and was causing the crash, after changing to the FQDN, terraform started working again.
Kind regards
QUESTION
I am trying to deploy ECS using Terraform and it's throwing the above error while I am Provisioning the ECR this is happening. It tried removing the double quotes, then enabled trace for troubleshooting. I tried updating to the latest version of terraform as well (v 1.1.2)
Here is the code chunk from main.tf file
...ANSWER
Answered 2022-Jan-04 at 23:34Updated:
A ${ ... }
sequence is an interpolation in Terraform's configuration language, which evaluates the expression given between the markers. Unix shells typically use $..
As per the official documentation, the command
is evaluated in a shell, and can use environment variables or Terraform variables. So, basically, what you are trying to achieve should work fundamentally.
I did a quick test and I was able to successfully apply that locally:
with double quotes
QUESTION
I have seeing some examples regarding how to pass annotations when deploying a helm chart via terraform but none of then are working as expected, in this case, im trying to create a service assining a private ip on a specific subnet, but instead, its creating a public IP. My terraform files:
...ANSWER
Answered 2021-Dec-16 at 22:15I just faced a similar issue, and here is what worked for me:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install terraform-provider
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page