-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1951432
commit f08b19e
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Hosted directory | ||
|
||
This directory is where I keep all hira code related to deploying infrastructure. For example, the hira public documentation site is defined here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hira |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "hiracliwebsite" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
||
[dependencies] | ||
hira = { path = "../../hira" } | ||
dotenv_reader = { path = "../../level2/dotenv_reader" } | ||
aws_cfn_stack = { path = "../../level2/aws_cfn_stack" } | ||
aws_s3 = { path = "../../level2/aws_s3" } | ||
aws_cloudfront_distribution = { path = "../../level2/aws_cloudfront_distribution" } | ||
# third party dependencies can be added via extern crate: | ||
#iam = { git = "https://github.com/nikita-skobov/aws_cfn_type_gen", rev = "66daeace6fbf11761026201728131bd9c668210b" } | ||
#cloud_front = { git = "https://github.com/nikita-skobov/aws_cfn_type_gen", rev = "66daeace6fbf11761026201728131bd9c668210b" } | ||
cfn_resources = { git = "https://github.com/nikita-skobov/aws_cfn_type_gen", rev = "66daeace6fbf11761026201728131bd9c668210b" } | ||
tokio = { version = "*", features = ["full"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
use hira::hira; | ||
use aws_s3::aws_s3; | ||
use dotenv_reader::dotenv_reader; | ||
use ::aws_cloudfront_distribution::s3_website_distribution::s3_website_distribution; | ||
|
||
#[hira] | ||
pub mod myvars { | ||
use super::dotenv_reader; | ||
|
||
pub mod outputs { | ||
pub const ACM_ARN: &str = "this will be replaced by the value in the .env file. If not found, this string will be used as the default"; | ||
pub const MY_DOMAIN: &str = "hiracli.com"; | ||
} | ||
|
||
pub fn config(inp: &mut dotenv_reader::Input) { | ||
inp.dotenv_path = ".env".to_string(); | ||
} | ||
} | ||
|
||
#[hira] | ||
pub mod hiradocs_bucket { | ||
use super::aws_s3; | ||
pub mod outputs { | ||
pub use super::aws_s3::outputs::*; | ||
} | ||
pub fn config(inp: &mut aws_s3::Input) { | ||
inp.is_website = true; | ||
} | ||
} | ||
|
||
#[hira] | ||
pub mod websitedistr { | ||
use super::myvars::outputs::{ACM_ARN, MY_DOMAIN}; | ||
use super::hiradocs_bucket::outputs::LOGICAL_BUCKET_NAME; | ||
use super::s3_website_distribution; | ||
use self::s3_website_distribution::CustomDomainSettings; | ||
|
||
pub fn config(distrinput: &mut s3_website_distribution::Input) { | ||
distrinput.logical_bucket_website_url = LOGICAL_BUCKET_NAME.to_string(); | ||
distrinput.custom_domain_settings = Some( | ||
CustomDomainSettings { | ||
acm_arn: ACM_ARN.to_string(), | ||
domain_name: MY_DOMAIN.to_string(), | ||
subdomain: Some("docs".to_string()), | ||
enable_route_53: false, | ||
..Default::default() | ||
} | ||
); | ||
} | ||
} |