Skip to content

Repository files navigation

Storm Library for Terraform

SSM-Managed Instance

An EC2 instance with AmazonSSMManagedInstanceCore policy included in its profile, allowing to connect to the instance securely via AWS SSM's Session Manager.

CheckPlanApplyTestDestroy

This repository is a member of the SLT | Storm Library for Terraform, a collection of Terraform modules for Amazon Web Services. The focus of these modules, maintained in separate GitHub™ repositories, is on building examples, demos and showcases on AWS. The audience of the library is learners and presenters alike - people that want to know or show how a certain service, pattern or solution looks like, or "feels".

Learn more

Installation

This demo can be built using GitHub Actions. In order to do so

Deployment of this member should take < 2 minutes on GitHub resources.

Architecture

Architecture

Explore this demo

This is rather a helper module than a demo. It provides for an EC2 instance with the AmazonSSMManagedInstanceCore AWS managed policy attached to its profile in order to login into your EC2 instance using AWS Session Manager.

The instance itself has no dedicated purpose. In the context of the Storm Library for Terraform it often serves as controller host, supporting the deployment flow where Terraform can't, or as an instance for interacting with and exploring of resources of a demo.

Terraform Docs

Requirements

NameVersion
terraform>= 1
aws>= 6

Providers

NameVersion
aws>= 6

Modules

No modules.

Resources

NameType
aws_iam_instance_profile.instanceresource
aws_iam_role.instanceresource
aws_iam_role_policy_attachment.additional_policiesresource
aws_iam_role_policy_attachment.administrator_accessresource
aws_iam_role_policy_attachment.amazon_ssm_managed_instance_coreresource
aws_instance.instanceresource
aws_ami.latest_amazon_linux_amidata source
aws_iam_policy.administrator_accessdata source
aws_iam_policy.amazon_ssm_managed_instance_coredata source
aws_iam_policy_document.client_assume_roledata source
aws_region.currentdata source

Inputs

NameDescriptionTypeDefaultRequired
_metadataSelect metadata passed from GitHub Workflows
object({
actor = string # Github actor (deployer) of the deployment
catalog_id = string # SLT catalog id of this module
deployment = string # slt-<catalod_id>--
ref = string # Git reference of the deployment
ref_name = string # Git ref_name (branch) of the deployment
repo = string # GitHub short repository name (without owner) of the deployment
repository = string # GitHub full repository name (including owner) of the deployment
sha = string # Git (full-length, 40 char) commit SHA of the deployment
short_name = string # slt-<catalog_id>-
time = string # Timestamp of the deployment
})
{
"actor": "",
"catalog_id": "",
"deployment": "",
"ref": "",
"ref_name": "",
"repo": "",
"repository": "",
"sha": "",
"short_name": "",
"time": ""
}
no
amiAMI (Id) to use for the instancestringnullno
dependenciesA list of dependencies to objects of any type. This variable is a workaround for
_depends_on_, which won't work because the module defines its own provider.
list(any)[]no
detailed_monitoringFlag for detailed monitoring. Make sure to understand cost/benefit relationship.
Check: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/manage-detailed-monitoring.html
booltrueno
instance_typeInstance typestring"t3.medium"no
key_nameKey pair name to usestringnullno
nameInstance namestringnullno
policiesList of IAM policy ARNs to attach to the instancelist(string)[]no
regionRegion where to deploy tostringnullno
root_volume_sizeRoot volume size in GBnumber50no
source_dest_checkDisable source/dest check (default true)booltrueno
subnet_idId of the subnet to create this instance instringnullno
user_dataUser data to pass to the instancestringnullno
user_data_base64User data to pass to the instance; base64-encodedstringnullno
vpc_security_group_idsList of security group IDs to use with the instancelist(string)nullno

Outputs

NameDescription
_slt_configMap of SLT configuration
dependenciesThe list of (pseudo) dependencies being passed to the module.
instanceThe SSM-managed instance being created.

About

An ec2 instance with AmazonSSMManagedInstanceCore policy included in its profile.

Resources

Stars

0 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages