Skip to content

Commit

Permalink
fix: Added Type to Undefined Variables and Improved code Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vedant990 committed Oct 4, 2024
1 parent 96ce634 commit 72219bc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/complete/service_principal_with_password/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
provider "azurerm" {

Check warning on line 1 in examples/complete/service_principal_with_password/main.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

Missing version constraint for provider "azurerm" in "required_providers"
features {}
subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX"
subscription_id = "000000-11111-1223-XXX-XXXXXXXXXXXX"
}
module "service-principal" {
source = "./../../.."
Expand Down
56 changes: 41 additions & 15 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variable "name" {
type = string
default = ""
description = "Name (e.g. `app` or `cluster`)."
description = "Name (e.g. `app` or `cluster`)."
}

variable "application" {

Check warning on line 7 in variables.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

variable "application" is declared but not used
Expand All @@ -19,32 +19,35 @@ variable "environment" {
variable "tags" {

Check warning on line 19 in variables.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

variable "tags" is declared but not used
type = map(any)
default = {}
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)."
description = "Additional tags (e.g. map(`BusinessUnit`, `XYZ`)."
}

variable "managedby" {
type = string
default = "[email protected]"
description = "ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'."
description = "ManagedBy, e.g. 'CloudDrove' or 'AnmolNagpal'."
}

variable "label_order" {
type = list(any)
type = list(string)
default = ["name", "environment"]
description = "Label order, e.g. `name`,`application`."
description = "Label order, e.g. `name`, `application`."
}

variable "repository" {
type = string
default = ""
description = "Terraform current module repo"
}

variable "service_principal_name" {

Check warning on line 43 in variables.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

variable "service_principal_name" is declared but not used
type = string
description = "The name of the service principal"
default = ""
}

variable "sign_in_audience" {
type = string
description = "The Microsoft account types that are supported for the current application. Must be one of `AzureADMyOrg`, `AzureADMultipleOrgs`, `AzureADandPersonalMicrosoftAccount` or `PersonalMicrosoftAccount`"
default = "AzureADMyOrg"
}
Expand All @@ -56,96 +59,110 @@ variable "alternative_names" {
}

variable "description" {
type = string
description = "A description of the service principal provided for internal end-users."
default = null
}

variable "role_definition_name" {

Check warning on line 67 in variables.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

variable "role_definition_name" is declared but not used
type = string
description = "The name of a Azure built-in Role for the service principal"
default = null
}

variable "password_end_date" {
type = string
description = "The relative duration or RFC3339 rotation timestamp after which the password expire"
default = null
}

variable "password_rotation_in_years" {
description = "Number of years to add to the base timestamp to configure the password rotation timestamp. Conflicts with password_end_date and either one is specified and not the both"
type = number
description = "Number of years to add to the base timestamp to configure the password rotation timestamp. Conflicts with password_end_date and either one must be specified, not both."
default = null
}

variable "password_rotation_in_days" {
description = "Number of days to add to the base timestamp to configure the rotation timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation.Conflicts with `password_end_date`, `password_rotation_in_years` and either one must be specified, not all"
type = number
description = "Number of days to add to the base timestamp to configure the rotation timestamp. When the current time has passed the rotation timestamp, the resource will trigger recreation. Conflicts with `password_end_date`, `password_rotation_in_years` and either one must be specified, not all."
default = null
}

variable "enable_service_principal_certificate" {
type = bool
description = "Manages a Certificate associated with a Service Principal within Azure Active Directory"
default = false
}

variable "certificate_encoding" {
type = string
description = "Specifies the encoding used for the supplied certificate data. Must be one of `pem`, `base64` or `hex`"
default = "pem"
}

variable "key_id" {
type = string
description = "A UUID used to uniquely identify this certificate. If not specified a UUID will be automatically generated."
default = null
}

variable "certificate_type" {
type = string
description = "The type of key/certificate. Must be one of AsymmetricX509Cert or Symmetric"
default = "AsymmetricX509Cert"
}

variable "certificate_path" {

Check warning on line 115 in variables.tf

View workflow job for this annotation

GitHub Actions / tf-lint / tflint

variable "certificate_path" is declared but not used
type = string
description = "The path to the certificate for this Service Principal"
default = ""
}

variable "azure_role_name" {
type = string
description = "A unique UUID/GUID for this Role Assignment - one will be generated if not specified."
default = null
}

variable "azure_role_description" {
type = string
description = "The description for this Role Assignment"
default = null
}

variable "assignments" {
description = "The list of role assignments to this service principal"
type = list(object({
scope = string
role_definition_name = string
}))
default = []
description = "The list of role assignments to this service principal"
default = []
}

variable "device_only_auth_enabled" {
type = bool
default = false
description = "Specifies whether this application supports device authentication without a user. Defaults to false."

}

variable "fallback_public_client_enabled" {
type = bool
default = false
description = " Specifies whether the application is a public client. Appropriate for apps using token grant flows that don't use a redirect URI. Defaults to false."
description = "Specifies whether the application is a public client. Appropriate for apps using token grant flows that don't use a redirect URI. Defaults to false."
}

variable "group_membership_claims" {
type = list(string)
default = []
description = "Configures the groups claim issued in a user or OAuth 2.0 access token that the app expects. Possible values are None, SecurityGroup, DirectoryRole, ApplicationGroup or All."
}

variable "identifier_uris" {
type = list(any)
type = list(string)
default = []
description = "A set of user-defined URI(s) that uniquely identify an application within its Azure AD tenant, or within a verified custom domain if the application is multi-tenant."
}

variable "logo_image" {
type = string
default = null
Expand All @@ -155,48 +172,57 @@ variable "logo_image" {
variable "account_enabled" {
type = bool
default = true
description = " Whether or not the service principal account is enabled. Defaults to true."
description = "Whether or not the service principal account is enabled. Defaults to true."
}

variable "app_role_assignment_required" {
type = bool
default = false
description = "Whether this service principal requires an app role assignment to a user or group before Azure AD will issue a user or access token to the application. Defaults to false."
}

variable "login_url" {
type = string
default = null
description = "The URL where the service provider redirects the user to Azure AD to authenticate. Azure AD uses the URL to launch the application from Microsoft 365 or the Azure AD My Apps. When blank, Azure AD performs IdP-initiated sign-on for applications configured with SAML-based single sign-on."
}

variable "notes" {
type = string
default = null
description = "A free text field to capture information about the service principal, typically used for operational purposes."
}

variable "notification_email_addresses" {
type = list(any)
type = list(string)
default = []
description = "A set of email addresses where Azure AD sends a notification when the active certificate is near the expiration date. This is only for the certificates used to sign the SAML token issued for Azure AD Gallery applications."
}

variable "preferred_single_sign_on_mode" {
type = string
default = ""
description = "The single sign-on mode configured for this application. Azure AD uses the preferred single sign-on mode to launch the application from Microsoft 365 or the Azure AD My Apps. Supported values are oidc, password, saml or notSupported. Omit this property or specify a blank string to unset."
}

variable "relay_state" {
type = string
default = null
description = "The relative URI the service provider would redirect to after completion of the single sign-on flow."
}

variable "use_existing" {
type = bool
default = false
description = "When true, any existing service principal linked to the same application will be automatically imported. When false, an import error will be raised for any pre-existing service principal."
}

variable "certificate_value" {
type = string
default = ""
description = "The certificate data, which can be PEM encoded, base64 encoded DER or hexadecimal encoded DER. See also the encoding argument."
}

variable "end_date" {
type = string
default = ""
Expand All @@ -206,5 +232,5 @@ variable "end_date" {
variable "display_name" {
type = string
default = "example.com"
description = " Specifies a friendly name for the certificate. Must start with CN=. Changing this field forces a new resource to be created."
description = "Specifies a friendly name for the certificate. Must start with CN=. Changing this field forces a new resource to be created."
}

0 comments on commit 72219bc

Please sign in to comment.