Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add timecheck function #77

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

SudharsaneSivamany
Copy link

@SudharsaneSivamany SudharsaneSivamany commented Nov 20, 2024

Issue_link: #79

Description

The timecheck function enables time-based infrastructure control in Terraform by validating whether the current time falls within specified operational windows. This function helps organizations optimize cloud costs, enforce maintenance windows, and ensure compliance by automatically managing resources based on business hours, time zones, and seasonal schedules. It's particularly valuable for automating the start/stop cycles of development environments, controlling maintenance windows, and implementing time-based security policies.

Key features:

  • Schedule resources based on business hours
  • Support for time zone-specific operations
  • Daily and monthly scheduling patterns
  • Native Terraform integration
  • Cross-provider compatibility

Common applications:

  • Development environment cost optimization
  • Maintenance window enforcement
  • Time-based security controls
  • Seasonal resource management

Production use case

  • In production terraform iac pipeline, execution of pipeline for deploying resource in cloud is done through service accounts/ service principals. Restriction for non business our deployment is managed by disabling the service account, but timecheck function fails the plan or apply during non-business hours, so service account disablement is not required
  • Cloud schedules run jobs to stop/start the instances , but still schedule jobs are not free. timecheck function will decide the stop/start whenever the pipeline was ran.
  • On weekly maintenance, hourly scheduled cicd iac pipeline will make use of timecheck function to splash up and down by relaxing the firewall rules.
  • From SRE perspective, configurations for alerts and monitoring can be changed based on the time.

…tools/github.com/hashicorp/terraform-plugin-docs-0.20.0

chore(deps): bump github.com/hashicorp/terraform-plugin-docs from 0.19.4 to 0.20.0 in /tools
@SudharsaneSivamany SudharsaneSivamany requested a review from a team as a code owner November 20, 2024 08:03
@github-actions github-actions bot added documentation Improvements or additions to documentation new-function Pull requests that update or introduce new functions tests labels Nov 20, 2024
Copy link

hashicorp-cla-app bot commented Nov 20, 2024

CLA assistant check
All committers have signed the CLA.

@SudharsaneSivamany
Copy link
Author

Hey @bschaatsbergen , Hope you are doing good. Could you please have a review on this PR , proceed to next step!!!

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new-function Pull requests that update or introduce new functions tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants