Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 7, 2024
1 parent 91c967f commit 4be8418
Show file tree
Hide file tree
Showing 16 changed files with 36 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 1

[[analyzers]]
name = "terraform"
name = "terraform"
1 change: 0 additions & 1 deletion .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ jobs:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@master
with:
working_directory: './examples/github-oidc/'

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
.terraform
.idea
*.iml
*.hcl
*.hcl
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.15.1]: https://github.com/clouddrove/terraform-aws-iam-role/compare/0.15.0...0.15.1
[1.0.1]: https://github.com/clouddrove/terraform-aws-iam-role/compare/0.15.1...1.0.1
[1.3.0]: https://github.com/clouddrove/terraform-aws-iam-role/compare/1.0.1...1.3.0
[1.3.1]: https://github.com/clouddrove/terraform-aws-iam-role/compare/1.3.0...1.3.1
[1.3.1]: https://github.com/clouddrove/terraform-aws-iam-role/compare/1.3.0...1.3.1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<hr>


We are a group of DevOps engineers & architects, joining hands in this ever evolving digital landscape. With our strong belief in Automation; just like microservices, always on the lookout to split the the infrastructure into smaller connected resources (database, cluster and more) which could be standardized, are manageable, scalable, secure & follow industry best practices.
We are a group of DevOps engineers & architects, joining hands in this ever evolving digital landscape. With our strong belief in Automation; just like microservices, always on the lookout to split the the infrastructure into smaller connected resources (database, cluster and more) which could be standardized, are manageable, scalable, secure & follow industry best practices.


This module includes Terraform open source, examples, and automation tests (for better understanding), which would help you create and improve your infrastructure with minimalistic coding.
Expand Down Expand Up @@ -79,7 +79,7 @@ This table contains both Prerequisites and Providers:
Refer to complete documentation: [here](docs/io.md)


<!--
<!--
## Module Dependencies
This module has dependencies on:
Expand Down Expand Up @@ -107,7 +107,7 @@ Refer [here](CHANGELOG.md).

## ✨ Contributors

Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward.
Big thanks to our contributors for elevating our project with their dedication and expertise! But, we do not wish to stop there, would like to invite contributions from the community in improving these projects and making them more versatile for better reach. Remember, every bit of contribution is immensely valuable, as, together, we are moving in only 1 direction, i.e. forward.

<a href="https://github.com/clouddrove/terraform-aws-iam-role/graphs/contributors">
<img src="https://contrib.rocks/image?repo=clouddrove/terraform-aws-iam-role&max" />
Expand Down Expand Up @@ -135,7 +135,7 @@ Big thanks to our contributors for elevating our project with their dedication a



## Feedback
## Feedback
Spot a bug or have thoughts to share with us? Let's squash it together! Log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-iam-role/issues), feel free to drop us an email at [[email protected]](mailto:[email protected]).

Show some love with a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-iam-role)! if our work has brightened your day! – your feedback fuels our journey!
Expand All @@ -147,7 +147,7 @@ We have [*100+ Terraform modules*][terraform_modules] 🙌. You could consider t

- [Terraform Module Registry:](https://registry.terraform.io/namespaces/clouddrove) Discover our Terraform modules here.

- [Terraform Modules for AWS/Azure Modules:](https://github.com/clouddrove/toc) Explore our comprehensive Table of Contents for easy navigation through our documentation for modules pertaining to AWS, Azure & GCP.
- [Terraform Modules for AWS/Azure Modules:](https://github.com/clouddrove/toc) Explore our comprehensive Table of Contents for easy navigation through our documentation for modules pertaining to AWS, Azure & GCP.

- [Terraform Modules for Digital Ocean:](https://github.com/terraform-do-modules/toc) Check out our specialized Terraform modules for Digital Ocean.

Expand All @@ -173,7 +173,7 @@ Join our tech elites [Join Now][slack] 🚀
Click [here][blog] :books: :star2:

## Tap into our capabilities
We provide a platform for organizations to engage with experienced top-tier DevOps & Cloud services. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud Solutions.
We provide a platform for organizations to engage with experienced top-tier DevOps & Cloud services. Tap into our pool of certified engineers and architects to elevate your DevOps and Cloud Solutions.

At [CloudDrove][website], has extensive experience in designing, building & migrating environments, securing, consulting, monitoring, optimizing, automating, and maintaining complex and large modern systems. With remarkable client footprints in American & European corridors, our certified architects & engineers are ready to serve you as per your requirements & schedule. Write to us at [[email protected]](mailto:[email protected]).

Expand Down
1 change: 0 additions & 1 deletion docs/io.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@
| policy | The policy document attached to the role. |
| role | The name of the role associated with the policy. |
| tags | A mapping of tags to assign to the resource. |

13 changes: 6 additions & 7 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ locals {
environment = "test"
}

##-----------------------------------------------------------------------------
## IAM role module call.
##-----------------------------------------------------------------------------
## IAM role module call.
##-----------------------------------------------------------------------------
module "iam-role" {
source = "./../../"
Expand All @@ -19,8 +19,8 @@ module "iam-role" {
policy = data.aws_iam_policy_document.iam-policy.json
}

##-----------------------------------------------------------------------------
## Data block to create IAM policy.
##-----------------------------------------------------------------------------
## Data block to create IAM policy.
##-----------------------------------------------------------------------------
data "aws_iam_policy_document" "default" {
statement {
Expand All @@ -33,8 +33,8 @@ data "aws_iam_policy_document" "default" {
}
}

##-----------------------------------------------------------------------------
## Data block to create IAM policy.
##-----------------------------------------------------------------------------
## Data block to create IAM policy.
##-----------------------------------------------------------------------------
data "aws_iam_policy_document" "iam-policy" {
statement {
Expand All @@ -48,4 +48,3 @@ data "aws_iam_policy_document" "iam-policy" {
resources = ["*"]
}
}

2 changes: 1 addition & 1 deletion examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ output "arn" {
output "tags" {
value = module.iam-role.tags
description = "A mapping of tags to assign to the resource."
}
}
5 changes: 2 additions & 3 deletions examples/github-oidc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ locals {
environment = "test"
}

##-----------------------------------------------------------------------------
## GitHub OIDC role module call.
##-----------------------------------------------------------------------------
## GitHub OIDC role module call.
##-----------------------------------------------------------------------------

module "aws_github_oidc_role" {
Expand All @@ -23,4 +23,3 @@ module "aws_github_oidc_role" {
provider_url = "https://token.actions.githubusercontent.com"
policy_arns = ["arn:aws:iam::aws:policy/AdministratorAccess"]
}

15 changes: 7 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##-----------------------------------------------------------------------------
## Labels module callled that will be used for naming and tags.
## Labels module callled that will be used for naming and tags.
##-----------------------------------------------------------------------------
module "labels" {
source = "clouddrove/labels/aws"
Expand All @@ -13,8 +13,8 @@ module "labels" {
label_order = var.label_order
}

##-----------------------------------------------------------------------------
## Below resource will deploy IAM role in AWS environment.
##-----------------------------------------------------------------------------
## Below resource will deploy IAM role in AWS environment.
##-----------------------------------------------------------------------------
resource "aws_iam_role" "default" {
count = var.enabled ? 1 : 0
Expand All @@ -29,8 +29,8 @@ resource "aws_iam_role" "default" {
tags = module.labels.tags
}

##-----------------------------------------------------------------------------
## Below resource will deploy IAM policy and attach it to above created IAM role.
##-----------------------------------------------------------------------------
## Below resource will deploy IAM policy and attach it to above created IAM role.
##-----------------------------------------------------------------------------
resource "aws_iam_role_policy" "default" {
count = var.enabled && var.policy_enabled && var.policy_arn == "" ? 1 : 0
Expand All @@ -39,12 +39,11 @@ resource "aws_iam_role_policy" "default" {
policy = var.policy
}

##-----------------------------------------------------------------------------
## Below resource will attach IAM policy to above created IAM role.
##-----------------------------------------------------------------------------
## Below resource will attach IAM policy to above created IAM role.
##-----------------------------------------------------------------------------
resource "aws_iam_role_policy_attachment" "default" {
count = var.enabled && var.policy_enabled && var.policy_arn != "" ? 1 : 0
role = aws_iam_role.default[0].id
policy_arn = var.policy_arn
}

4 changes: 2 additions & 2 deletions modules/aws_github_oidc_role/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Before using this configuration, make sure you have the following prerequisites:
## Example
```bash
module "aws_oidc_role" {
source = "clouddrove/iam-role/aws//modules/aws_github_oidc_role"
source = "clouddrove/iam-role/aws//modules/aws_github_oidc_role"

# Module input variables
provider_url = "https://token.actions.githubusercontent.com"
Expand Down Expand Up @@ -64,5 +64,5 @@ Before using this configuration, make sure you have the following prerequisites:
1. To destroy the created resources, run:
```bash
terraform destroy
2. Confirm the destruction by typing yes when prompted.
12 changes: 6 additions & 6 deletions modules/aws_github_oidc_role/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


##-----------------------------------------------------------------------------
## Labels module callled that will be used for naming and tags.
## Labels module callled that will be used for naming and tags.
##-----------------------------------------------------------------------------
module "labels" {
source = "clouddrove/labels/aws"
Expand All @@ -14,15 +14,15 @@ module "labels" {
label_order = var.label_order
}

##-----------------------------------------------------------------------------
## Data block to tls certificate.
##-----------------------------------------------------------------------------
## Data block to tls certificate.
##-----------------------------------------------------------------------------

data "tls_certificate" "github" {
url = var.provider_url
}

##-----------------------------------------------------------------------------
##-----------------------------------------------------------------------------
## Data block for openid connect provider
##-----------------------------------------------------------------------------

Expand All @@ -32,7 +32,7 @@ data "aws_iam_openid_connect_provider" "github" {
}

##-----------------------------------------------------------------------------
## Include iam openid connect provider resource here
## Include iam openid connect provider resource here
##-----------------------------------------------------------------------------


Expand Down Expand Up @@ -85,4 +85,4 @@ resource "aws_iam_role_policy_attachment" "github" {
count = length(var.policy_arns)
role = aws_iam_role.github.name
policy_arn = var.policy_arns[count.index]
}
}
2 changes: 1 addition & 1 deletion modules/aws_github_oidc_role/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ output "arn" {
output "tags" {
description = "The gets tags provided for role"
value = module.labels.tags
}
}
1 change: 0 additions & 1 deletion modules/aws_github_oidc_role/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,3 @@ variable "policy_arns" {
type = list(string)
description = "A list of policies/permissions to attach to the IAM role."
}

2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ output "policy" {
output "role" {
value = aws_iam_role_policy.default[0].role
description = "The name of the role associated with the policy."
}
}

0 comments on commit 4be8418

Please sign in to comment.