Skip to content

Instantly share code, notes, and snippets.

@nivleshc
nivleshc / blog-photo-location-map-cognito-04.tf
Created March 23, 2025 03:44
This gist contains code from the file cognito.tf which is part of the blog-photo-location-map repository.
output "cognito_ui_url" {
value = "https://${aws_cognito_user_pool.user_pool.domain}.auth.${local.region}.amazoncognito.com/login?client_id=${aws_cognito_user_pool_client.user_pool_client.id}&response_type=code&scope=openid&redirect_uri=${tolist(aws_cognito_user_pool_client.user_pool_client.callback_urls)[0]}"
depends_on = [aws_cognito_user_pool.user_pool]
}
output "cognito_user_pool_id" {
value = aws_cognito_user_pool.user_pool.id
}
output "cognito_user_pool_client_id" {
@nivleshc
nivleshc / blog-photo-location-map-cognito-03.tf
Created March 23, 2025 03:36
This gist contains code from the file cognito.tf which is part of the blog-photo-location-map repository.
resource "aws_cognito_user_pool_domain" "user_pool_domain" {
domain = local.cognito_user_pool_domain # Must be globally unique
user_pool_id = aws_cognito_user_pool.user_pool.id
}
@nivleshc
nivleshc / blog-photo-location-map-cognito-02.tf
Created March 23, 2025 03:29
This gist contains code from the file cognito.tf which is part of the blog-photo-location-map repository.
resource "aws_cognito_user_pool_client" "user_pool_client" {
name = local.cognito_user_pool_client_name
user_pool_id = aws_cognito_user_pool.user_pool.id
supported_identity_providers = ["COGNITO"]
# Do not generate a client secret for browser-based apps
generate_secret = false
# Allowed OAuth flows and scopes for the hosted UI.
allowed_oauth_flows_user_pool_client = true
@nivleshc
nivleshc / blog-photo-location-map-cognito-01.tf
Created March 23, 2025 03:18
This gist contains code from the file cognito.tf which is part of the blog-photo-location-map repository.
resource "aws_cognito_user_pool" "user_pool" {
name = local.cognito_user_pool_name
# Customize password policy, MFA, etc., as needed
password_policy {
minimum_length = local.cognito_password_policy.minimum_length
require_uppercase = local.cognito_password_policy.require_uppercase
require_lowercase = local.cognito_password_policy.require_lowercase
require_numbers = local.cognito_password_policy.require_numbers
require_symbols = local.cognito_password_policy.require_symbols
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-values.yaml
Created August 21, 2024 10:10
This gist contains code from the helm/s3-csi-demo/values.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
storageClass:
name: s3-storageclass
provisioner: s3.csi.aws.com # Provisioner for AWS S3
parameters:
type: standard
persistentVolume:
name: s3-pv
capacity:
storageSize: 5Gi
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-nginx.yaml
Created August 21, 2024 10:05
This gist contains code from the helm/s3-csi-demo/templates/nginx.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: v1
kind: Pod
metadata:
name: {{ .Values.nginx.name }}
labels:
{{- with .Values.nginx.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
containers:
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-pvc.yaml
Created August 21, 2024 10:00
This gist contains code from the helm/s3-csi-demo/templates/s3-storageclass.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.persistentVolumeClaim.name }}
spec:
accessModes:
- {{ .Values.persistentVolumeClaim.accessModes }}
storageClassName: {{ .Values.persistentVolumeClaim.storageClassName }}
resources:
requests:
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-pv.yaml
Created August 21, 2024 09:52
This gist contains code from the helm/s3-csi-demo/templates/pv.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Values.persistentVolume.name }}
spec:
capacity:
storage: {{ .Values.persistentVolume.capacity.storageSize }}
volumeMode: {{ .Values.persistentVolume.volumeMode }}
accessModes:
- {{ .Values.persistentVolume.accessModes }}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-helm-s3-storageclass.yaml
Created August 21, 2024 09:48
This gist contains code from the helm/s3-csi-demo/templates/s3-storageclass.yaml file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.storageClass.name }}
provisioner: {{ .Values.storageClass.provisioner }} # Provisioner for AWS S3
parameters:
type: {{ .Values.storageClass.parameters.type }}
@nivleshc
nivleshc / blog-amazon-s3-filesystem-amazon-eks-eks-outputs-03.tf
Created August 18, 2024 12:09
This gist contains code from the eks/outputs.tf file which is part of the blog-amazon-s3-filesystem-for-amazon-eks-cluster repository.
output "cluster_auth_token" {
description = "Amazon Elastic Kubernetes Service Cluster Authentication Token"
value = data.aws_eks_cluster_auth.eks_cluster.token
}