removed 'untested' examples
This commit is contained in:
parent
091621acf9
commit
86c720d0d5
15 changed files with 0 additions and 729 deletions
|
|
@ -1,254 +0,0 @@
|
|||
# Authentication Examples
|
||||
|
||||
This directory contains examples demonstrating the different authentication methods supported by the Edge Connect Terraform provider.
|
||||
|
||||
## Configuration Methods
|
||||
|
||||
The provider supports configuration via:
|
||||
1. **Explicit Configuration** - Setting values directly in your Terraform files
|
||||
2. **Environment Variables** - Using environment variables (recommended for CI/CD and production)
|
||||
3. **Hybrid Approach** - Mixing both methods (explicit config takes precedence)
|
||||
|
||||
## Authentication Methods
|
||||
|
||||
The provider supports two mutually exclusive authentication methods:
|
||||
|
||||
### 1. Token-based Authentication
|
||||
|
||||
Token authentication uses a pre-generated API token for authentication.
|
||||
|
||||
**File:** `token-auth.tf`
|
||||
|
||||
**Advantages:**
|
||||
- More secure (tokens can be scoped and rotated)
|
||||
- Better for CI/CD pipelines
|
||||
- Recommended for production use
|
||||
|
||||
**Usage:**
|
||||
```hcl
|
||||
provider "edge-connect" {
|
||||
endpoint = "https://api.edge-connect.example.com"
|
||||
token = var.edge_connect_token
|
||||
}
|
||||
```
|
||||
|
||||
**Environment Variables:**
|
||||
You can set credentials directly via provider-specific environment variables:
|
||||
```bash
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
export EDGE_CONNECT_TOKEN="your-token-here"
|
||||
terraform apply
|
||||
```
|
||||
|
||||
Alternatively, use Terraform variables:
|
||||
```bash
|
||||
export TF_VAR_edge_connect_token="your-token-here"
|
||||
terraform apply
|
||||
```
|
||||
|
||||
### 2. Username/Password Authentication
|
||||
|
||||
Username/password authentication uses standard user credentials.
|
||||
|
||||
**File:** `username-password-auth.tf`
|
||||
|
||||
**Advantages:**
|
||||
- Simpler for development and testing
|
||||
- No token generation required
|
||||
- Familiar authentication method
|
||||
|
||||
**Usage:**
|
||||
```hcl
|
||||
provider "edge-connect" {
|
||||
endpoint = "https://api.edge-connect.example.com"
|
||||
username = var.edge_connect_username
|
||||
password = var.edge_connect_password
|
||||
}
|
||||
```
|
||||
|
||||
**Environment Variables:**
|
||||
You can set credentials directly via provider-specific environment variables:
|
||||
```bash
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
export EDGE_CONNECT_USERNAME="your-username"
|
||||
export EDGE_CONNECT_PASSWORD="your-password"
|
||||
terraform apply
|
||||
```
|
||||
|
||||
Alternatively, use Terraform variables:
|
||||
```bash
|
||||
export TF_VAR_edge_connect_username="your-username"
|
||||
export TF_VAR_edge_connect_password="your-password"
|
||||
terraform apply
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
The provider supports the following environment variables that can be used instead of explicit configuration:
|
||||
|
||||
| Environment Variable | Description | Required |
|
||||
|---------------------|-------------|----------|
|
||||
| `EDGE_CONNECT_ENDPOINT` | API endpoint URL | Yes |
|
||||
| `EDGE_CONNECT_TOKEN` | API token | Conditional* |
|
||||
| `EDGE_CONNECT_USERNAME` | Username for authentication | Conditional* |
|
||||
| `EDGE_CONNECT_PASSWORD` | Password for authentication | Conditional* |
|
||||
|
||||
\* Either `EDGE_CONNECT_TOKEN` OR both `EDGE_CONNECT_USERNAME` and `EDGE_CONNECT_PASSWORD` must be provided.
|
||||
|
||||
### Using Environment Variables Only
|
||||
|
||||
**File:** `env-vars.tf`
|
||||
|
||||
You can configure the provider without any explicit configuration by using environment variables:
|
||||
|
||||
```hcl
|
||||
provider "edge-connect" {
|
||||
# Configuration will be read from environment variables
|
||||
}
|
||||
```
|
||||
|
||||
**Token Authentication:**
|
||||
```bash
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
export EDGE_CONNECT_TOKEN="your-token-here"
|
||||
terraform init
|
||||
terraform plan
|
||||
terraform apply
|
||||
```
|
||||
|
||||
**Username/Password Authentication:**
|
||||
```bash
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
export EDGE_CONNECT_USERNAME="your-username"
|
||||
export EDGE_CONNECT_PASSWORD="your-password"
|
||||
terraform init
|
||||
terraform plan
|
||||
terraform apply
|
||||
```
|
||||
|
||||
### Precedence Rules
|
||||
|
||||
When both explicit configuration and environment variables are provided:
|
||||
1. Explicit configuration values take precedence
|
||||
2. If a value is not explicitly configured, the provider checks environment variables
|
||||
3. If neither is provided, validation errors occur
|
||||
|
||||
**Example of precedence:**
|
||||
```hcl
|
||||
provider "edge-connect" {
|
||||
endpoint = "https://api.edge-connect.example.com" # Explicit
|
||||
# token will be read from EDGE_CONNECT_TOKEN env var
|
||||
}
|
||||
```
|
||||
|
||||
### Helper Scripts
|
||||
|
||||
See the example shell scripts in this directory:
|
||||
- `env-vars-token.sh` - Set up token authentication via environment variables
|
||||
- `env-vars-userpass.sh` - Set up username/password authentication via environment variables
|
||||
|
||||
Make them executable and source them:
|
||||
```bash
|
||||
chmod +x env-vars-token.sh
|
||||
source ./env-vars-token.sh
|
||||
```
|
||||
|
||||
## Important Notes
|
||||
|
||||
1. **Mutual Exclusivity:** You must use EITHER token OR username/password, not both. The provider will return an error if both methods are provided.
|
||||
|
||||
2. **Required Credentials:**
|
||||
- For token auth: `endpoint` and `token` are required
|
||||
- For username/password auth: `endpoint`, `username`, and `password` are required
|
||||
|
||||
3. **Security Best Practices:**
|
||||
- Never commit credentials to version control
|
||||
- Prefer environment variables over hardcoded values in Terraform files
|
||||
- Use environment variables or secure secret management systems
|
||||
- Mark sensitive variables with `sensitive = true`
|
||||
- Use `.gitignore` to exclude `terraform.tfvars` files
|
||||
- Consider using tools like `direnv` for automatic environment variable management
|
||||
|
||||
## Validation Rules
|
||||
|
||||
The provider validates authentication credentials with the following rules:
|
||||
|
||||
- At least one authentication method must be provided
|
||||
- Both authentication methods cannot be used simultaneously
|
||||
- For username/password auth, both username and password must be provided together
|
||||
|
||||
## Error Messages
|
||||
|
||||
### Missing Credentials
|
||||
```
|
||||
Error: Missing Authentication Credentials
|
||||
|
||||
The provider requires authentication credentials. Please provide either:
|
||||
- token: API token for authentication (via 'token' attribute or EDGE_CONNECT_TOKEN environment variable), or
|
||||
- username and password: Username and password for authentication (via 'username'/'password' attributes or EDGE_CONNECT_USERNAME/EDGE_CONNECT_PASSWORD environment variables)
|
||||
```
|
||||
|
||||
### Conflicting Methods
|
||||
```
|
||||
Error: Conflicting Authentication Methods
|
||||
|
||||
Both token and username/password authentication methods are provided.
|
||||
Please use only one authentication method.
|
||||
```
|
||||
|
||||
### Incomplete Credentials
|
||||
```
|
||||
Error: Incomplete Username/Password Credentials
|
||||
|
||||
Both username and password must be provided together for username/password authentication.
|
||||
```
|
||||
|
||||
## Testing Examples
|
||||
|
||||
### Using Explicit Configuration
|
||||
|
||||
To test token authentication:
|
||||
```bash
|
||||
cd examples/authentication
|
||||
terraform init
|
||||
terraform plan -var="edge_connect_token=your-token" -target=edge-connect_app.token_example
|
||||
```
|
||||
|
||||
To test username/password authentication:
|
||||
```bash
|
||||
cd examples/authentication
|
||||
terraform init
|
||||
terraform plan \
|
||||
-var="edge_connect_username=your-username" \
|
||||
-var="edge_connect_password=your-password" \
|
||||
-target=edge-connect_app.userpass_example
|
||||
```
|
||||
|
||||
### Using Environment Variables
|
||||
|
||||
To test with environment variables (token auth):
|
||||
```bash
|
||||
cd examples/authentication
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
export EDGE_CONNECT_TOKEN="your-token"
|
||||
terraform init
|
||||
terraform plan -target=edge-connect_app.env_example
|
||||
```
|
||||
|
||||
To test with environment variables (username/password auth):
|
||||
```bash
|
||||
cd examples/authentication
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
export EDGE_CONNECT_USERNAME="your-username"
|
||||
export EDGE_CONNECT_PASSWORD="your-password"
|
||||
terraform init
|
||||
terraform plan -target=edge-connect_app.env_example
|
||||
```
|
||||
|
||||
## Recommendations
|
||||
|
||||
- **Production Environments:** Use token-based authentication with properly scoped and rotated tokens via environment variables
|
||||
- **Development Environments:** Either method is acceptable, but token auth is still recommended. Use environment variables or `.tfvars` files
|
||||
- **CI/CD Pipelines:** Use token-based authentication with secrets management (e.g., HashiCorp Vault, AWS Secrets Manager) passed as environment variables
|
||||
- **Local Development:** Use environment variables with tools like `direnv` for automatic management
|
||||
- **Configuration Management:** Prefer environment variables over hardcoded values for better security and flexibility
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Example: Using environment variables for token authentication
|
||||
#
|
||||
# This script demonstrates how to set environment variables for
|
||||
# token-based authentication with the Edge Connect provider.
|
||||
|
||||
# Set the API endpoint
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
|
||||
# Set the API token
|
||||
export EDGE_CONNECT_TOKEN="your-api-token-here"
|
||||
|
||||
# Now you can run Terraform commands without passing credentials
|
||||
echo "Environment variables set. You can now run:"
|
||||
echo " terraform init"
|
||||
echo " terraform plan"
|
||||
echo " terraform apply"
|
||||
|
||||
# Example: Run terraform plan
|
||||
# terraform plan
|
||||
|
||||
# Note: You can also set these in your shell profile (~/.bashrc, ~/.zshrc)
|
||||
# or use a tool like direnv for directory-specific environment variables
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Example: Using environment variables for username/password authentication
|
||||
#
|
||||
# This script demonstrates how to set environment variables for
|
||||
# username/password authentication with the Edge Connect provider.
|
||||
|
||||
# Set the API endpoint
|
||||
export EDGE_CONNECT_ENDPOINT="https://api.edge-connect.example.com"
|
||||
|
||||
# Set username and password
|
||||
export EDGE_CONNECT_USERNAME="your-username"
|
||||
export EDGE_CONNECT_PASSWORD="your-password"
|
||||
|
||||
# Now you can run Terraform commands without passing credentials
|
||||
echo "Environment variables set. You can now run:"
|
||||
echo " terraform init"
|
||||
echo " terraform plan"
|
||||
echo " terraform apply"
|
||||
|
||||
# Example: Run terraform plan
|
||||
# terraform plan
|
||||
|
||||
# Note: You can also set these in your shell profile (~/.bashrc, ~/.zshrc)
|
||||
# or use a tool like direnv for directory-specific environment variables
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Example: Environment Variable Authentication
|
||||
#
|
||||
# This example demonstrates how to authenticate with the Edge Connect
|
||||
# provider using environment variables instead of explicit configuration.
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
edge-connect = {
|
||||
source = "local/edge-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Provider configured entirely via environment variables
|
||||
# No explicit configuration needed - provider will read from:
|
||||
# - EDGE_CONNECT_ENDPOINT
|
||||
# - EDGE_CONNECT_TOKEN (for token auth)
|
||||
# OR
|
||||
# - EDGE_CONNECT_USERNAME and EDGE_CONNECT_PASSWORD (for username/password auth)
|
||||
|
||||
provider "edge-connect" {
|
||||
# All values will be read from environment variables
|
||||
}
|
||||
|
||||
# Example resource
|
||||
resource "edge-connect_app" "env_example" {
|
||||
name = "env-var-app"
|
||||
version = "1.0.0"
|
||||
}
|
||||
|
||||
output "app_id" {
|
||||
value = edge-connect_app.env_example.id
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Example: Token-based Authentication
|
||||
#
|
||||
# This example demonstrates how to authenticate with the Edge Connect
|
||||
# provider using an API token.
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
edge-connect = {
|
||||
source = "local/edge-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "edge-connect" {
|
||||
endpoint = "https://api.edge-connect.example.com"
|
||||
token = var.edge_connect_token
|
||||
}
|
||||
|
||||
variable "edge_connect_token" {
|
||||
description = "API token for Edge Connect"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
# Example resource
|
||||
resource "edge-connect_app" "token_example" {
|
||||
name = "token-auth-app"
|
||||
version = "1.0.0"
|
||||
}
|
||||
|
||||
output "app_id" {
|
||||
value = edge-connect_app.token_example.id
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
# Example: Username/Password Authentication
|
||||
#
|
||||
# This example demonstrates how to authenticate with the Edge Connect
|
||||
# provider using username and password credentials.
|
||||
|
||||
terraform {
|
||||
required_providers {
|
||||
edge-connect = {
|
||||
source = "local/edge-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "edge-connect" {
|
||||
endpoint = "https://api.edge-connect.example.com"
|
||||
username = var.edge_connect_username
|
||||
password = var.edge_connect_password
|
||||
}
|
||||
|
||||
variable "edge_connect_username" {
|
||||
description = "Username for Edge Connect API"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "edge_connect_password" {
|
||||
description = "Password for Edge Connect API"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
# Example resource
|
||||
resource "edge-connect_app" "userpass_example" {
|
||||
name = "userpass-auth-app"
|
||||
version = "1.0.0"
|
||||
}
|
||||
|
||||
output "app_id" {
|
||||
value = edge-connect_app.userpass_example.id
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
edge-connect = {
|
||||
source = "local/edge-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Option 1: Token-based authentication
|
||||
provider "edge-connect" {
|
||||
endpoint = "https://api.edge-connect.example.com"
|
||||
token = var.edge_connect_token
|
||||
}
|
||||
|
||||
# Option 2: Username/password authentication (uncomment to use)
|
||||
# provider "edge-connect" {
|
||||
# endpoint = var.edge_connect_endpoint
|
||||
# username = var.edge_connect_username
|
||||
# password = var.edge_connect_password
|
||||
# }
|
||||
|
||||
# Create a simple app
|
||||
resource "edge-connect_app" "example" {
|
||||
name = "my-app"
|
||||
version = "1.0.0"
|
||||
description = "Example application"
|
||||
}
|
||||
|
||||
output "app_id" {
|
||||
description = "The ID of the created app"
|
||||
value = edge-connect_app.example.id
|
||||
}
|
||||
|
||||
output "app_status" {
|
||||
description = "The status of the created app"
|
||||
value = edge-connect_app.example.status
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
# Copy this file to terraform.tfvars and fill in your values
|
||||
|
||||
# Option 1: Use token-based authentication
|
||||
edge_connect_token = "your-api-token-here"
|
||||
|
||||
# Option 2: Use username/password authentication (uncomment and fill in)
|
||||
# edge_connect_username = "your-username"
|
||||
# edge_connect_password = "your-password"
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
variable "edge_connect_endpoint" {
|
||||
description = "Edge Connect API endpoint URL"
|
||||
type = string
|
||||
default = "https://api.edge-connect.example.com"
|
||||
}
|
||||
|
||||
# Token-based authentication
|
||||
variable "edge_connect_token" {
|
||||
description = "Authentication token for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
sensitive = true
|
||||
default = ""
|
||||
}
|
||||
|
||||
# Username/password authentication
|
||||
variable "edge_connect_username" {
|
||||
description = "Username for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "edge_connect_password" {
|
||||
description = "Password for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
sensitive = true
|
||||
default = ""
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
edge-connect = {
|
||||
source = "local/edge-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Provider configuration with token authentication
|
||||
provider "edge-connect" {
|
||||
endpoint = var.edge_connect_endpoint
|
||||
token = var.edge_connect_token
|
||||
}
|
||||
|
||||
# Alternative: Username/password authentication (uncomment to use)
|
||||
# provider "edge-connect" {
|
||||
# endpoint = var.edge_connect_endpoint
|
||||
# username = var.edge_connect_username
|
||||
# password = var.edge_connect_password
|
||||
# }
|
||||
|
||||
# Create an application
|
||||
resource "edge-connect_app" "web_app" {
|
||||
name = "web-application"
|
||||
version = "2.1.0"
|
||||
description = "Production web application"
|
||||
}
|
||||
|
||||
# Create an app instance for the application
|
||||
resource "edge-connect_app_instance" "web_app_instance" {
|
||||
name = "web-app-prod-instance"
|
||||
app_id = edge-connect_app.web_app.id
|
||||
description = "Production instance of web application"
|
||||
config = jsonencode({
|
||||
environment = "production"
|
||||
replicas = 3
|
||||
resources = {
|
||||
cpu = "2"
|
||||
memory = "4Gi"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
# Create another app with a different version
|
||||
resource "edge-connect_app" "api_app" {
|
||||
name = "api-service"
|
||||
version = "1.5.0"
|
||||
}
|
||||
|
||||
# Create multiple instances of the API app
|
||||
resource "edge-connect_app_instance" "api_instance_east" {
|
||||
name = "api-service-east"
|
||||
app_id = edge-connect_app.api_app.id
|
||||
config = jsonencode({
|
||||
region = "us-east-1"
|
||||
})
|
||||
}
|
||||
|
||||
resource "edge-connect_app_instance" "api_instance_west" {
|
||||
name = "api-service-west"
|
||||
app_id = edge-connect_app.api_app.id
|
||||
config = jsonencode({
|
||||
region = "us-west-2"
|
||||
})
|
||||
}
|
||||
|
||||
# Outputs
|
||||
output "web_app_id" {
|
||||
description = "ID of the web application"
|
||||
value = edge-connect_app.web_app.id
|
||||
}
|
||||
|
||||
output "web_app_status" {
|
||||
description = "Status of the web application"
|
||||
value = edge-connect_app.web_app.status
|
||||
}
|
||||
|
||||
output "web_app_instance_id" {
|
||||
description = "ID of the web app instance"
|
||||
value = edge-connect_app_instance.web_app_instance.id
|
||||
}
|
||||
|
||||
output "web_app_instance_status" {
|
||||
description = "Status of the web app instance"
|
||||
value = edge-connect_app_instance.web_app_instance.status
|
||||
}
|
||||
|
||||
output "api_instances" {
|
||||
description = "API service instances"
|
||||
value = {
|
||||
east = {
|
||||
id = edge-connect_app_instance.api_instance_east.id
|
||||
status = edge-connect_app_instance.api_instance_east.status
|
||||
}
|
||||
west = {
|
||||
id = edge-connect_app_instance.api_instance_west.id
|
||||
status = edge-connect_app_instance.api_instance_west.status
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# Copy this file to terraform.tfvars and fill in your values
|
||||
edge_connect_endpoint = "https://api.edge-connect.example.com"
|
||||
|
||||
# Option 1: Use token-based authentication
|
||||
edge_connect_token = "your-api-token-here"
|
||||
|
||||
# Option 2: Use username/password authentication (uncomment and fill in)
|
||||
# edge_connect_username = "your-username"
|
||||
# edge_connect_password = "your-password"
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
variable "edge_connect_endpoint" {
|
||||
description = "Edge Connect API endpoint URL"
|
||||
type = string
|
||||
default = "https://api.edge-connect.example.com"
|
||||
}
|
||||
|
||||
# Token-based authentication
|
||||
variable "edge_connect_token" {
|
||||
description = "Authentication token for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
sensitive = true
|
||||
default = ""
|
||||
}
|
||||
|
||||
# Username/password authentication
|
||||
variable "edge_connect_username" {
|
||||
description = "Username for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "edge_connect_password" {
|
||||
description = "Password for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
sensitive = true
|
||||
default = ""
|
||||
}
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
edge-connect = {
|
||||
source = "local/edge-connect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Provider configuration with token authentication
|
||||
provider "edge-connect" {
|
||||
endpoint = var.edge_connect_endpoint
|
||||
token = var.edge_connect_token
|
||||
}
|
||||
|
||||
# Alternative: Username/password authentication (uncomment to use)
|
||||
# provider "edge-connect" {
|
||||
# endpoint = var.edge_connect_endpoint
|
||||
# username = var.edge_connect_username
|
||||
# password = var.edge_connect_password
|
||||
# }
|
||||
|
||||
# Data source: Look up an existing app by ID
|
||||
data "edge-connect_app" "existing_app" {
|
||||
id = var.app_id
|
||||
}
|
||||
|
||||
# Data source: Look up an existing app instance by ID
|
||||
data "edge-connect_app_instance" "existing_instance" {
|
||||
id = var.app_instance_id
|
||||
}
|
||||
|
||||
# You can use data from data sources to create new resources
|
||||
resource "edge-connect_app_instance" "new_instance" {
|
||||
name = "new-instance-based-on-existing"
|
||||
app_id = data.edge-connect_app.existing_app.name
|
||||
description = "New instance created based on existing app: ${data.edge-connect_app.existing_app.name}"
|
||||
}
|
||||
|
||||
# Outputs showing data source information
|
||||
output "existing_app_info" {
|
||||
description = "Information about the existing app"
|
||||
value = {
|
||||
id = data.edge-connect_app.existing_app.id
|
||||
name = data.edge-connect_app.existing_app.name
|
||||
version = data.edge-connect_app.existing_app.version
|
||||
description = data.edge-connect_app.existing_app.description
|
||||
status = data.edge-connect_app.existing_app.status
|
||||
}
|
||||
}
|
||||
|
||||
output "existing_instance_info" {
|
||||
description = "Information about the existing app instance"
|
||||
value = {
|
||||
id = data.edge-connect_app_instance.existing_instance.id
|
||||
name = data.edge-connect_app_instance.existing_instance.name
|
||||
app_id = data.edge-connect_app_instance.existing_instance.app_id
|
||||
description = data.edge-connect_app_instance.existing_instance.description
|
||||
status = data.edge-connect_app_instance.existing_instance.status
|
||||
}
|
||||
}
|
||||
|
||||
output "new_instance_id" {
|
||||
description = "ID of the newly created instance"
|
||||
value = edge-connect_app_instance.new_instance.id
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Copy this file to terraform.tfvars and fill in your values
|
||||
edge_connect_endpoint = "https://api.edge-connect.example.com"
|
||||
|
||||
# Option 1: Use token-based authentication
|
||||
edge_connect_token = "your-api-token-here"
|
||||
|
||||
# Option 2: Use username/password authentication (uncomment and fill in)
|
||||
# edge_connect_username = "your-username"
|
||||
# edge_connect_password = "your-password"
|
||||
|
||||
# Data source lookup IDs
|
||||
app_id = "my-existing-app"
|
||||
app_instance_id = "my-existing-instance"
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
variable "edge_connect_endpoint" {
|
||||
description = "Edge Connect API endpoint URL"
|
||||
type = string
|
||||
default = "https://api.edge-connect.example.com"
|
||||
}
|
||||
|
||||
# Token-based authentication
|
||||
variable "edge_connect_token" {
|
||||
description = "Authentication token for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
sensitive = true
|
||||
default = ""
|
||||
}
|
||||
|
||||
# Username/password authentication
|
||||
variable "edge_connect_username" {
|
||||
description = "Username for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "edge_connect_password" {
|
||||
description = "Password for Edge Connect API (use either token OR username/password)"
|
||||
type = string
|
||||
sensitive = true
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "app_id" {
|
||||
description = "ID of an existing app to look up"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "app_instance_id" {
|
||||
description = "ID of an existing app instance to look up"
|
||||
type = string
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue