{ "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "AdminName": { "NoEcho": "false", "Type": "String", "Description": "New admin account name", "MinLength": "1", "MaxLength": "41", "AllowedPattern": "[a-zA-Z0-9]*", "ConstraintDescription": "Must contain only alphanumeric characters." }, "AdminPassword": { "NoEcho": "true", "Type": "String", "Description": "New admin account password", "MinLength": "16", "MaxLength": "41", "AllowedPattern": "[a-zA-Z0-9]*", "ConstraintDescription": "Must contain only alphanumeric characters." } }, "Resources": { "AdminUser": { "Type": "AWS::IAM::User", "Properties": { "Groups": [ { "Ref": "AdminGroup" } ], "UserName": { "Ref": "AdminName" }, "LoginProfile": { "Password": { "Ref": "AdminPassword" } } } }, "AdminGroup": { "Type": "AWS::IAM::Group", "Properties": { "GroupName": "Admin", "ManagedPolicyArns": [ "arn:aws:iam::aws:policy/AdministratorAccess" ] } }, "AdminKey": { "Type": "AWS::IAM::AccessKey", "Properties": { "UserName": { "Ref": "AdminUser" } } "DependsOn": [ "AdminUser" ] } }, "Outputs": { "AccessKey": { "Value": { "Ref": "AdminKey" }, "Description": "AWSAccessKeyId of admin user" }, "SecretKey": { "Value": { "Fn::GetAtt": [ "AdminKey", "SecretAccessKey" ] }, "Description": "AWSSecretKey of admin user" } } }