Skip to content

feat: Add timeouts block for vpc origin resource#165

Merged
bryantbiggs merged 7 commits intoterraform-aws-modules:masterfrom
Ichigo97438:master
Jun 27, 2025
Merged

feat: Add timeouts block for vpc origin resource#165
bryantbiggs merged 7 commits intoterraform-aws-modules:masterfrom
Ichigo97438:master

Conversation

@Ichigo97438
Copy link
Contributor

@Ichigo97438 Ichigo97438 commented Jun 4, 2025

Description

Adds timeouts configuration for vpc origin resource.

resource "aws_cloudfront_vpc_origin" "this" {
  for_each = local.create_vpc_origin ? var.vpc_origin : {}

  vpc_origin_endpoint_config {
    name                   = each.value["name"]
    arn                    = each.value["arn"]
    http_port              = each.value["http_port"]
    https_port             = each.value["https_port"]
    origin_protocol_policy = each.value["origin_protocol_policy"]

    origin_ssl_protocols {
      items    = each.value.origin_ssl_protocols.items
      quantity = each.value.origin_ssl_protocols.quantity
    }
  }

  timeouts {
    create = try(var.vpc_origin_timeouts.create, null)
    update = try(var.vpc_origin_timeouts.update, null)
    delete = try(var.vpc_origin_timeouts.delete, null)
  }

  tags = var.tags
}

Motivation and Context

Resolves #163

VPC Origin creation can be longer than default terraform timeout, which stops deployments and forces to manually untaint resource before continuing deployment.
This PR adds an optional timeout configuration in the vpc_origin variable and uses this configuration in the aws_cloudfront_vpc_origin resource.

Breaking Changes

N/A

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@Ichigo97438 Ichigo97438 changed the title feat: add timeouts block for vpc origin resource Add timeouts block for vpc origin resource Jun 4, 2025
@Ichigo97438 Ichigo97438 changed the title Add timeouts block for vpc origin resource feat: add timeouts block for vpc origin resource Jun 4, 2025
@Ichigo97438 Ichigo97438 changed the title feat: add timeouts block for vpc origin resource feat: Add timeouts block for vpc origin resource Jun 4, 2025
@bryantbiggs
Copy link
Member

ah, this module still supports Terraform 0.13.x which means we won't be able to use variable optional attributes (1.3+)

we'll have to wait to take a breaking change to update

@Ichigo97438
Copy link
Contributor Author

@bryantbiggs
I created a new variable vpc_origin_timeouts instead so as to not use optional and avoid breaking changes.

@Ichigo97438
Copy link
Contributor Author

Hi @bryantbiggs!
The latest pipeline failed because of an issue in module ec2 (terraform-aws-modules/terraform-aws-ec2-instance#434).
It is not related to the changes in this pull request.

Can this pull request still be merged or should changes be made to versions.tf file to force the aws provider version following the quick fix mentioned in the issue?

@bryantbiggs bryantbiggs merged commit dac9b8a into terraform-aws-modules:master Jun 27, 2025
6 checks passed
antonbabenko pushed a commit that referenced this pull request Jun 27, 2025
## [4.2.0](v4.1.0...v4.2.0) (2025-06-27)

### Features

* Add timeouts block for vpc origin resource ([#165](#165)) ([dac9b8a](dac9b8a))
@antonbabenko
Copy link
Member

This PR is included in version 4.2.0 🎉

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VPC Origin timeout after 15min

3 participants