Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions terraform/platform/dns/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,49 @@ resource "aws_route53_record" "teknologihuset_no_carddav_txt" {
ttl = 3600
records = ["path=/"]
}

# ==============================================================================
# aws.javabin.no → IAM Identity Center SSO portal redirect
#
# S3 website hosting bucket configured to redirect all requests to the
# Identity Center portal. Route53 alias points to the S3 website endpoint.
# This only handles HTTP — browsers follow the 301 to the HTTPS portal.
# ==============================================================================

resource "aws_s3_bucket" "sso_redirect" {
bucket = "aws.javabin.no"

tags = {
Name = "aws.javabin.no-redirect"
}
}

resource "aws_s3_bucket_website_configuration" "sso_redirect" {
bucket = aws_s3_bucket.sso_redirect.id

redirect_all_requests_to {
host_name = "javabin.awsapps.com"
protocol = "https"
}
}

resource "aws_s3_bucket_public_access_block" "sso_redirect" {
bucket = aws_s3_bucket.sso_redirect.id

block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}

resource "aws_route53_record" "sso_redirect" {
zone_id = aws_route53_zone.javabin_no.zone_id
name = "aws.javabin.no"
type = "A"

alias {
name = aws_s3_bucket_website_configuration.sso_redirect.website_domain
zone_id = aws_s3_bucket.sso_redirect.hosted_zone_id
evaluate_target_health = false
}
}
11 changes: 11 additions & 0 deletions terraform/platform/dns/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,14 @@ variable "project" {
description = "Project name for tagging"
type = string
}

variable "region" {
description = "AWS region"
type = string
}

variable "sso_portal_url" {
description = "IAM Identity Center portal URL to redirect aws.javabin.no to"
type = string
default = "https://javabin.awsapps.com/start"
}
1 change: 1 addition & 0 deletions terraform/platform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,5 @@ module "identity" {
module "dns" {
source = "./dns"
project = var.project
region = var.region
}